diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-12-22 13:36:20 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-12-22 13:47:11 -0700 |
commit | a03ea684efc3505647cf0327a501aa2dbb591ad2 (patch) | |
tree | 2e3836f0fe873994a5398cce7e782635f9e5077d /railties/test/fixtures/lib | |
parent | 82afeaf23b0cc190d1ed2c8858a11980c71ac336 (diff) | |
download | rails-a03ea684efc3505647cf0327a501aa2dbb591ad2.tar.gz rails-a03ea684efc3505647cf0327a501aa2dbb591ad2.tar.bz2 rails-a03ea684efc3505647cf0327a501aa2dbb591ad2.zip |
Use the new `foreign_key` option on `references` in generators
Changes `rails g model Post user:references` from
def change
create_table :posts do |t|
t.references :user, index: true
end
add_foreign_key :posts, :users
end
to
def change
create_table :posts do |t|
t.references :user, index: true, foreign_key: true
end
end
Changes `rails g migration add_user_to_posts user:references` from
def change
add_reference :posts, :users, index: true
add_foreign_key :posts, :users
end
to
def change
add_reference :posts, :users, index: true, foreign_key: true
end
Diffstat (limited to 'railties/test/fixtures/lib')
0 files changed, 0 insertions, 0 deletions