Rails Exporter Plugin
Many to Many Relation
http://rails.kirschekreativ.de/many-to-many-relation.html

Copyright © 2013 Joerg Kirschstein

 

Many to Many Relation

Two tables are converted to model-, migration-, schema- and seeds files. Contains n:m relationship with join table.

MySQL Schema

MODEL FILES


SCHEMA FILE


MIGRATION FILES


SEEDS FILE [excerpt]


CMD 'Rake db:setup'


SEEDED DATABASE [excerpt]