aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-12-16 14:51:22 +0000
committerJon Leighton <j@jonathanleighton.com>2011-12-16 14:51:22 +0000
commiteba581846e731bd4b455facbe947ddafa5512cfc (patch)
tree8b8ab0d00f743e0fadefacffc36e6e86597925e5 /activerecord/lib
parent7b1eeea5bc69747b5bfde2af2c7245339da2be74 (diff)
downloadrails-eba581846e731bd4b455facbe947ddafa5512cfc.tar.gz
rails-eba581846e731bd4b455facbe947ddafa5512cfc.tar.bz2
rails-eba581846e731bd4b455facbe947ddafa5512cfc.zip
Fix the build on postgres. Note: we should probably actually make schema mutations bust the cache.
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/attribute_methods/primary_key.rb2
1 files changed, 1 insertions, 1 deletions
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'