From eba581846e731bd4b455facbe947ddafa5512cfc Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Fri, 16 Dec 2011 14:51:22 +0000 Subject: Fix the build on postgres. Note: we should probably actually make schema mutations bust the cache. --- activerecord/lib/active_record/attribute_methods/primary_key.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/attribute_methods/primary_key.rb b/activerecord/lib/active_record/attribute_methods/primary_key.rb index f575b26d04..5d37088d98 100644 --- a/activerecord/lib/active_record/attribute_methods/primary_key.rb +++ b/activerecord/lib/active_record/attribute_methods/primary_key.rb @@ -72,7 +72,7 @@ module ActiveRecord when :table_name_with_underscore base_name.foreign_key else - if ActiveRecord::Base != self && table_name + if ActiveRecord::Base != self && table_exists? connection.schema_cache.primary_keys[table_name] else 'id' -- cgit v1.2.3