aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorMarcin Raczkowski <marcin.raczkowski@gmail.com>2010-10-03 20:33:59 +0200
committerEmilio Tagua <miloops@gmail.com>2010-11-19 19:08:12 -0300
commit76f33dc372a057ae163a34710693510896cda9ac (patch)
treeec0497663396099ea09c179503a9ebd92b8eb4ff /activerecord/lib
parent740450514ce86d56926d8749b1e230012b368567 (diff)
downloadrails-76f33dc372a057ae163a34710693510896cda9ac.tar.gz
rails-76f33dc372a057ae163a34710693510896cda9ac.tar.bz2
rails-76f33dc372a057ae163a34710693510896cda9ac.zip
Reeject attributes even if association is loaded
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/nested_attributes.rb1
1 files changed, 0 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb
index 0c3392263a..93c0ca52e3 100644
--- a/activerecord/lib/active_record/nested_attributes.rb
+++ b/activerecord/lib/active_record/nested_attributes.rb
@@ -399,7 +399,6 @@ module ActiveRecord
unless reject_new_record?(association_name, attributes)
association.build(attributes.except(*UNASSIGNABLE_KEYS))
end
-
elsif existing_record = existing_records.detect { |record| record.id.to_s == attributes['id'].to_s }
association.send(:add_record_to_target_with_callbacks, existing_record) if !association.loaded? && !call_reject_if(association_name, attributes)
assign_to_or_mark_for_destruction(existing_record, attributes, options[:allow_destroy])