Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use size for Ruby 1.8.6 compatibility.

  • Loading branch information...
commit 68bfd8a392a92e09fb8b870025227dbbda34fbb4 1 parent 549b2ad
@josevalim josevalim authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  activerecord/lib/active_record/nested_attributes.rb
View
2  activerecord/lib/active_record/nested_attributes.rb
@@ -359,7 +359,7 @@ def assign_nested_attributes_for_collection_association(association_name, attrib
association.build(attributes.except(*UNASSIGNABLE_KEYS))
end
- elsif existing_records.count == 0 #Existing record but not yet associated
+ elsif existing_records.size == 0 # Existing record but not yet associated
existing_record = self.class.reflect_on_association(association_name).klass.find(attributes['id'])
association.send(:add_record_to_target_with_callbacks, existing_record) unless association.loaded?
assign_to_or_mark_for_destruction(existing_record, attributes, options[:allow_destroy])
Please sign in to comment.
Something went wrong with that request. Please try again.