Permalink
Browse files

Remove dead branch code that appeared back in a merge.

  • Loading branch information...
josevalim committed Apr 10, 2011
1 parent f654021 commit 62b2755f7a4ca12491a7899348066695a6a26917
Showing with 0 additions and 6 deletions.
  1. +0 −6 activerecord/lib/active_record/nested_attributes.rb
@@ -403,12 +403,6 @@ def assign_nested_attributes_for_collection_association(association_name, attrib
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

0 comments on commit 62b2755

Please sign in to comment.