diff --git a/lib/composite_primary_keys/nested_attributes.rb b/lib/composite_primary_keys/nested_attributes.rb index d9d15c37..77811c63 100644 --- a/lib/composite_primary_keys/nested_attributes.rb +++ b/lib/composite_primary_keys/nested_attributes.rb @@ -66,7 +66,7 @@ def assign_nested_attributes_for_collection_association(association_name, attrib # Make sure we are operating on the actual object which is in the association's # proxy_target array (either by finding it, or adding it if not found) # Take into account that the proxy_target may have changed due to callbacks - target_record = cpk_detect_record(attributes['id'], association.target) + target_record = cpk_detect_record(attributes['id'], association.target) if target_record existing_record = target_record else