Permalink
Browse files

Fix the build on postgres. Note: we should probably actually make sch…

…ema mutations bust the cache.
  • Loading branch information...
1 parent 7b1eeea commit eba581846e731bd4b455facbe947ddafa5512cfc @jonleighton jonleighton committed Dec 16, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/attribute_methods/primary_key.rb
@@ -72,7 +72,7 @@ def get_primary_key(base_name) #:nodoc:
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'

0 comments on commit eba5818

Please sign in to comment.