diff options
author | namusyaka <namusyaka@gmail.com> | 2017-02-08 00:41:56 +0900 |
---|---|---|
committer | namusyaka <namusyaka@gmail.com> | 2017-02-09 01:57:50 +0900 |
commit | 3df9117abc7980c54df675503409d9bdcddc1fee (patch) | |
tree | 5dcdeb89934e04b4a53a624b912e2f3699afc149 /activerecord/lib/active_record/attribute_methods | |
parent | 47113df0341cd7bf56056bc666527978c586c7c5 (diff) | |
download | rails-3df9117abc7980c54df675503409d9bdcddc1fee.tar.gz rails-3df9117abc7980c54df675503409d9bdcddc1fee.tar.bz2 rails-3df9117abc7980c54df675503409d9bdcddc1fee.zip |
Fix inspection behavior when the :id column is not primary key
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/read.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/read.rb b/activerecord/lib/active_record/attribute_methods/read.rb index 369a6e35aa..fdc4bf6621 100644 --- a/activerecord/lib/active_record/attribute_methods/read.rb +++ b/activerecord/lib/active_record/attribute_methods/read.rb @@ -54,7 +54,7 @@ module ActiveRecord attr_name.to_s end - name = self.class.primary_key if name == "id".freeze + name = self.class.primary_key if name == "id".freeze && self.class.primary_key _read_attribute(name, &block) end |