diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-15 04:33:45 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-15 04:33:45 +0000 |
commit | 2e2ce1f6c99e3423e817003927997f28ba20365b (patch) | |
tree | fe0e050ae846cde73a513d5ef85b23435fc0b3c4 /railties/lib/rails_generator | |
parent | ae8179f05c49867e1136204bdf6d14a8fd4a7596 (diff) | |
download | rails-2e2ce1f6c99e3423e817003927997f28ba20365b.tar.gz rails-2e2ce1f6c99e3423e817003927997f28ba20365b.tar.bz2 rails-2e2ce1f6c99e3423e817003927997f28ba20365b.zip |
Generated fixtures use the actual primary key instead of id. Closes #4343.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7899 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/rails_generator')
-rw-r--r-- | railties/lib/rails_generator/generators/components/model/templates/fixtures.yml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml b/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml index eb3ab81ab8..c58dd85b00 100644 --- a/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml +++ b/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml @@ -1,13 +1,13 @@ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html one: - id: 1 + <%= class_name.constantize.primary_key %>: 1 <% for attribute in attributes -%> <%= attribute.name %>: <%= attribute.default %> <% end -%> created_at: <%= Time.now.to_s(:db) %> updated_at: <%= Time.now.to_s(:db) %> two: - id: 2 + <%= class_name.constantize.primary_key %>: 2 <% for attribute in attributes -%> <%= attribute.name %>: <%= attribute.default %> <% end -%> |