Permalink
Browse files

Fixed fixtures using primary key fields called something else than "id"

#270 [dave]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@53 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 7cc27b7 commit 35c89c4176c12353cd772c61e1d2dc5202b4d44f @dhh dhh committed Dec 6, 2004
Showing with 3 additions and 1 deletion.
  1. +2 −0 activerecord/CHANGELOG
  2. +1 −1 activerecord/lib/active_record/fixtures.rb
@@ -1,5 +1,7 @@
*CVS*
+* Fixed fixtures using primary key fields called something else than "id" [dave]
+
* Added proper handling of time fields that are turned into Time objects with the dummy date of 2000/1/1 [HariSeldon]
* Added reverse order of deleting fixtures, so referential keys can be maintained #247 [Tim Bates]
@@ -151,7 +151,7 @@ def value_list
end
def find
- Object.const_get(@class_name).find(self["id"])
+ Object.const_get(@class_name).find(self[Object.const_get(@class_name).primary_key])
end
private

0 comments on commit 35c89c4

Please sign in to comment.