aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/CHANGELOG2
-rwxr-xr-xactiverecord/lib/active_record/fixtures.rb2
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