diff options
Diffstat (limited to 'activerecord/lib/active_record/associations/has_one_association.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/has_one_association.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb index 74e82f146a..30704b6f7e 100644 --- a/activerecord/lib/active_record/associations/has_one_association.rb +++ b/activerecord/lib/active_record/associations/has_one_association.rb @@ -25,9 +25,9 @@ module ActiveRecord @loaded = true unless @owner.new_record? or obj.nil? or dont_save - return (obj.save ? obj : false) + return (obj.save ? self : false) else - return obj + return (obj.nil? ? nil : self) end end |