diff options
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/belongs_to_association.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/has_one_association.rb | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/associations/belongs_to_association.rb b/activerecord/lib/active_record/associations/belongs_to_association.rb index a818a780ed..11e16de738 100644 --- a/activerecord/lib/active_record/associations/belongs_to_association.rb +++ b/activerecord/lib/active_record/associations/belongs_to_association.rb @@ -10,11 +10,9 @@ module ActiveRecord replace_keys(record) set_inverse_instance(record) - @target = record @updated = true if record - loaded - record + self.target = record end def updated? diff --git a/activerecord/lib/active_record/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb index c38843ea68..1b366b74b6 100644 --- a/activerecord/lib/active_record/associations/has_one_association.rb +++ b/activerecord/lib/active_record/associations/has_one_association.rb @@ -24,8 +24,7 @@ module ActiveRecord end end - @target = record - loaded + self.target = record end private |