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
This commit is contained in:
parent
ae8179f05c
commit
2e2ce1f6c9
@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Generated fixtures use the actual primary key instead of id. #4343 [Frederick Ros, Tarmo Tänav]
|
||||
|
||||
* Extend the console +helper+ method to allow you to include custom helpers. e.g:
|
||||
>> helper :posts
|
||||
>> helper.some_method_from_posts_helper(Post.find(1))
|
||||
|
@ -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 -%>
|
||||
|
Loading…
Reference in New Issue
Block a user