diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-12-15 13:23:18 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-12-15 13:23:28 +0000 |
commit | 8dba32f125cc0b79fe453f38b1044c7bf9fb52ce (patch) | |
tree | 0e01a18f50f771a8d6967cde806b97477ebcc74c /activerecord/lib/active_record | |
parent | d7e714adacb18034b9121e4a05d6b119d9e6ef6a (diff) | |
download | rails-8dba32f125cc0b79fe453f38b1044c7bf9fb52ce.tar.gz rails-8dba32f125cc0b79fe453f38b1044c7bf9fb52ce.tar.bz2 rails-8dba32f125cc0b79fe453f38b1044c7bf9fb52ce.zip |
Fix #3987.
Diffstat (limited to 'activerecord/lib/active_record')
-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: |