aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-12-12 15:58:39 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-12-12 15:59:44 -0800
commitd12e6d0e2f71aa82db2338258d252600a79b35ba (patch)
tree49e57c1267ca0f77bfd41222ccfb071ded757c6d /activerecord/lib/active_record/attribute_methods
parent400929fb44ce58db3bebcaf4f685c3cd0eb2b739 (diff)
downloadrails-d12e6d0e2f71aa82db2338258d252600a79b35ba.tar.gz
rails-d12e6d0e2f71aa82db2338258d252600a79b35ba.tar.bz2
rails-d12e6d0e2f71aa82db2338258d252600a79b35ba.zip
use the schema cache when asking for the primary key
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-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 c756924186..746682393e 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 && connection.table_exists?(table_name)
+ if ActiveRecord::Base != self && connection.schema_cache.table_exists?(table_name)
connection.primary_key(table_name)
else
'id'