Permalink
Browse files

Use size for Ruby 1.8.6 compatibility.

  • Loading branch information...
1 parent 549b2ad commit 68bfd8a392a92e09fb8b870025227dbbda34fbb4 @josevalim josevalim committed Jun 23, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 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])

0 comments on commit 68bfd8a

Please sign in to comment.