From 64747654ca661d695622c0ad9e33b8d9e6df8048 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Wed, 5 Oct 2011 18:11:25 +0100 Subject: Revert "Raise error on unknown primary key." This reverts commit ee2be435b1e5c0e94a4ee93a1a310e0471a77d07. --- activerecord/lib/active_record/persistence.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/persistence.rb') diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index b5dadb929d..5e65e46a7d 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -314,7 +314,7 @@ module ActiveRecord new_id = self.class.unscoped.insert attributes_values - self.id ||= new_id if self.class.primary_key? + self.id ||= new_id if self.class.primary_key IdentityMap.add(self) if IdentityMap.enabled? @new_record = false -- cgit v1.2.3