Fix the build on postgres. Note: we should probably actually make schema mutations bust the cache.

This commit is contained in:
Jon Leighton
2011-12-16 14:51:22 +00:00
parent 7b1eeea5bc
commit eba581846e

View File

@@ -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'