diff options
author | Matthew M. Boedicker <matthewm@boedicker.org> | 2013-01-04 22:20:36 -0800 |
---|---|---|
committer | Matthew M. Boedicker <matthewm@boedicker.org> | 2013-01-04 22:20:36 -0800 |
commit | d60ed3d401b7b45c2debef561c2a7740eee1a511 (patch) | |
tree | 3b70e829e2b4c9a1b1252649ddd292141de52a39 /railties | |
parent | 28fd867c9bc790636d37a28f288791cd0089a6fd (diff) | |
download | rails-d60ed3d401b7b45c2debef561c2a7740eee1a511.tar.gz rails-d60ed3d401b7b45c2debef561c2a7740eee1a511.tar.bz2 rails-d60ed3d401b7b45c2debef561c2a7740eee1a511.zip |
Add join table migration generator to usage help.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/rails/migration/USAGE | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/migration/USAGE b/railties/lib/rails/generators/rails/migration/USAGE index f340ed97f2..baf3d9894f 100644 --- a/railties/lib/rails/generators/rails/migration/USAGE +++ b/railties/lib/rails/generators/rails/migration/USAGE @@ -20,3 +20,16 @@ Example: add_column :posts, :title, :string add_column :posts, :body, :text add_column :posts, :published, :boolean + +Migration names containing JoinTable will generate join tables for use with +has_and_belongs_to_many associations. + +Example: + `rails g migration CreateMediaJoinTable artists musics:uniq` + + will create the migration + + create_join_table :artists, :musics do |t| + # t.index [:artist_id, :music_id] + t.index [:music_id, :artist_id], unique: true + end |