diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-04-06 18:55:00 -0700 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-04-06 18:55:00 -0700 |
commit | 136e3a46e139e6105b0f18c29f7207bac7770be6 (patch) | |
tree | 1666d95b7d668ff2b66ca969b93f6394ee6ce40e /activerecord/lib | |
parent | 4d8e23463f120f0b057f1b4a10cda9fed809d89b (diff) | |
parent | 3552760157415f0e91a5f4f53ea5ae0955117e83 (diff) | |
download | rails-136e3a46e139e6105b0f18c29f7207bac7770be6.tar.gz rails-136e3a46e139e6105b0f18c29f7207bac7770be6.tar.bz2 rails-136e3a46e139e6105b0f18c29f7207bac7770be6.zip |
Merge pull request #10123 from wangjohn/added_bang_to_raise_nested_attributes_method
Added a bang to the raise_nested_attributes_record_not_found method
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/nested_attributes.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb index f0c29bbf73..d607f49e2b 100644 --- a/activerecord/lib/active_record/nested_attributes.rb +++ b/activerecord/lib/active_record/nested_attributes.rb @@ -362,7 +362,7 @@ module ActiveRecord assign_to_or_mark_for_destruction(record, attributes, options[:allow_destroy]) unless call_reject_if(association_name, attributes) elsif attributes['id'].present? - raise_nested_attributes_record_not_found(association_name, attributes['id']) + raise_nested_attributes_record_not_found!(association_name, attributes['id']) elsif !reject_new_record?(association_name, attributes) method = "build_#{association_name}" @@ -452,7 +452,7 @@ module ActiveRecord assign_to_or_mark_for_destruction(existing_record, attributes, options[:allow_destroy]) end else - raise_nested_attributes_record_not_found(association_name, attributes['id']) + raise_nested_attributes_record_not_found!(association_name, attributes['id']) end end end @@ -514,7 +514,7 @@ module ActiveRecord end end - def raise_nested_attributes_record_not_found(association_name, record_id) + def raise_nested_attributes_record_not_found!(association_name, record_id) raise RecordNotFound, "Couldn't find #{self.class.reflect_on_association(association_name).klass.name} with ID=#{record_id} for #{self.class.name} with ID=#{id}" end end |