diff options
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/primary_key.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/primary_key.rb b/activerecord/lib/active_record/attribute_methods/primary_key.rb index e3c7344f59..0560f63949 100644 --- a/activerecord/lib/active_record/attribute_methods/primary_key.rb +++ b/activerecord/lib/active_record/attribute_methods/primary_key.rb @@ -102,6 +102,8 @@ module ActiveRecord @original_primary_key = @primary_key if defined?(@primary_key) @primary_key = value && value.to_s @quoted_primary_key = nil + + connection.schema_cache.primary_keys[table_name] = @primary_key if connected? end def set_primary_key(value = nil, &block) #:nodoc: |