diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2015-06-16 13:36:28 -0600 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-06-16 13:36:28 -0600 |
commit | af01f45f068ea382257090ec8a3aa2579e56dbdc (patch) | |
tree | 3e6c4e892f9c406fb7fa8763ef389f4708b15643 /activerecord/lib | |
parent | e60c18931c81a88f4eb89059e955d6ff07c5e26c (diff) | |
parent | ba7377e8176315e7ac6ba1c24b2479925dc37cde (diff) | |
download | rails-af01f45f068ea382257090ec8a3aa2579e56dbdc.tar.gz rails-af01f45f068ea382257090ec8a3aa2579e56dbdc.tar.bz2 rails-af01f45f068ea382257090ec8a3aa2579e56dbdc.zip |
Merge pull request #20578 from dcrec1/regression
raise ActiveModel::MissingAttributeError when trying to access a relationship without the foreign key attribute
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/belongs_to_association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/belongs_to_association.rb b/activerecord/lib/active_record/associations/belongs_to_association.rb index 265a65c4c1..260a0c6a2d 100644 --- a/activerecord/lib/active_record/associations/belongs_to_association.rb +++ b/activerecord/lib/active_record/associations/belongs_to_association.rb @@ -107,7 +107,7 @@ module ActiveRecord end def stale_state - result = owner._read_attribute(reflection.foreign_key) + result = owner._read_attribute(reflection.foreign_key) { |n| owner.send(:missing_attribute, n, caller) } result && result.to_s end end |