aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-04-10 13:03:49 +0200
committerJosé Valim <jose.valim@gmail.com>2011-04-10 13:03:49 +0200
commit62b2755f7a4ca12491a7899348066695a6a26917 (patch)
tree6980f09d52cbc2fa21d214dd1297478a121b9954 /activerecord/lib
parentf6540211b5b9133c9f93c11655a04d613c237e67 (diff)
downloadrails-62b2755f7a4ca12491a7899348066695a6a26917.tar.gz
rails-62b2755f7a4ca12491a7899348066695a6a26917.tar.bz2
rails-62b2755f7a4ca12491a7899348066695a6a26917.zip
Remove dead branch code that appeared back in a merge.
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/nested_attributes.rb6
1 files changed, 0 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb
index c111a968dc..08b27b6a8e 100644
--- a/activerecord/lib/active_record/nested_attributes.rb
+++ b/activerecord/lib/active_record/nested_attributes.rb
@@ -403,12 +403,6 @@ module ActiveRecord
unless reject_new_record?(association_name, attributes)
association.build(attributes.except(*UNASSIGNABLE_KEYS))
end
- elsif existing_records.count == 0 #Existing record but not yet associated
- existing_record = self.class.reflect_on_association(association_name).klass.find(attributes['id'])
- if !call_reject_if(association_name, attributes)
- association.send(:add_record_to_target_with_callbacks, existing_record) if !association.loaded?
- assign_to_or_mark_for_destruction(existing_record, attributes, options[:allow_destroy])
- end
elsif existing_record = existing_records.detect { |record| record.id.to_s == attributes['id'].to_s }
unless association.loaded? || call_reject_if(association_name, attributes)
# Make sure we are operating on the actual object which is in the association's