diff options
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/has_one_association.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb index a4332a0511..693c80163a 100644 --- a/activerecord/lib/active_record/associations/has_one_association.rb +++ b/activerecord/lib/active_record/associations/has_one_association.rb @@ -32,9 +32,9 @@ module ActiveRecord loaded if @owner.persisted? && record && save - record.save && self - else - record && self + unless record.save + raise RecordNotSaved, "Failed to save the new associated #{@reflection.name}." + end end end |