aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/collection_association.rb
diff options
context:
space:
mode:
authorwangjohn <wangjohn@mit.edu>2013-03-21 11:56:02 -0400
committerwangjohn <wangjohn@mit.edu>2013-03-21 11:58:36 -0400
commit53b76c1a5472ef3de211316ec6e4dddacd1a3944 (patch)
tree855abe4cc88156d9fb36c3f8e1d95c5a1d07486b /activerecord/lib/active_record/associations/collection_association.rb
parent34d9aed32ed785148bcb97b027b9a90ee2850603 (diff)
downloadrails-53b76c1a5472ef3de211316ec6e4dddacd1a3944.tar.gz
rails-53b76c1a5472ef3de211316ec6e4dddacd1a3944.tar.bz2
rails-53b76c1a5472ef3de211316ec6e4dddacd1a3944.zip
Adding a bang to method name of raise_on_type_mismatch.
Diffstat (limited to 'activerecord/lib/active_record/associations/collection_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/collection_association.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb
index 51bcac61c7..2385c90c1a 100644
--- a/activerecord/lib/active_record/associations/collection_association.rb
+++ b/activerecord/lib/active_record/associations/collection_association.rb
@@ -318,7 +318,7 @@ module ActiveRecord
# Replace this collection with +other_array+. This will perform a diff
# and delete/add only records that have changed.
def replace(other_array)
- other_array.each { |val| raise_on_type_mismatch(val) }
+ other_array.each { |val| raise_on_type_mismatch!(val) }
original_target = load_target.dup
if owner.new_record?
@@ -465,7 +465,7 @@ module ActiveRecord
def delete_or_destroy(records, method)
records = records.flatten
- records.each { |record| raise_on_type_mismatch(record) }
+ records.each { |record| raise_on_type_mismatch!(record) }
existing_records = records.reject { |r| r.new_record? }
if existing_records.empty?
@@ -506,7 +506,7 @@ module ActiveRecord
result = true
records.flatten.each do |record|
- raise_on_type_mismatch(record)
+ raise_on_type_mismatch!(record)
add_to_target(record) do |rec|
result &&= insert_record(rec) unless owner.new_record?
end