aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorwangjohn <wangjohn@mit.edu>2013-04-06 21:36:58 -0400
committerwangjohn <wangjohn@mit.edu>2013-04-06 21:36:58 -0400
commit3552760157415f0e91a5f4f53ea5ae0955117e83 (patch)
tree1666d95b7d668ff2b66ca969b93f6394ee6ce40e /activerecord
parent4d8e23463f120f0b057f1b4a10cda9fed809d89b (diff)
downloadrails-3552760157415f0e91a5f4f53ea5ae0955117e83.tar.gz
rails-3552760157415f0e91a5f4f53ea5ae0955117e83.tar.bz2
rails-3552760157415f0e91a5f4f53ea5ae0955117e83.zip
Added a bang to the end of +raise_nested_attributes_record_not_found+
method to signify an exception possibly being raised.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/nested_attributes.rb6
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