diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-06 18:56:49 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-06 18:56:49 +0000 |
commit | 35c89c4176c12353cd772c61e1d2dc5202b4d44f (patch) | |
tree | 5826ddaf2e68c9d0b744bb06ac4002581ea634e1 /activerecord | |
parent | 7cc27b7b792a5a672348a37de64b08f5ce20f203 (diff) | |
download | rails-35c89c4176c12353cd772c61e1d2dc5202b4d44f.tar.gz rails-35c89c4176c12353cd772c61e1d2dc5202b4d44f.tar.bz2 rails-35c89c4176c12353cd772c61e1d2dc5202b4d44f.zip |
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
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/CHANGELOG | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/fixtures.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index d4e681af1d..fe04e4773e 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -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] diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index df41a1e370..56dc6bf383 100755 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -151,7 +151,7 @@ class Fixture #:nodoc: 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 |