nested_attribute_reassignable 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec3d8fcdf3ca69fc5dee0187426672f42dac4615
|
4
|
+
data.tar.gz: 00036b9d96ffd71fca77f98a0ff44561b48f0520
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5975f5aa6d8b23d3d346a349ab46e1e4fe6163aed8f6f1e107514d610fcc734bda8c677a9be2700ec9ca1603271f6722b6af4f1132f7ac0c06ae874a7d0aba5c
|
7
|
+
data.tar.gz: 051bd808be12a771cd584f467fc5e0ae48468afe407dd9557a53f792db567f2b221c9da0938ae07a3ed900e1270983d95678b0c94b1d6bd456c74ac972a6f8e1
|
@@ -103,6 +103,7 @@ It is invalid to create a new '#{@relation}' relation when one already exists, a
|
|
103
103
|
else
|
104
104
|
if nonexistent_id == :create
|
105
105
|
new_record = association_klass.new(lookup_key => id_attributes[:id])
|
106
|
+
new_record.assign_attributes(id_attributes.except(:id))
|
106
107
|
self.send(association_name).concat(new_record)
|
107
108
|
else
|
108
109
|
raise_nested_attributes_record_not_found!(association_name, id_attributes[:id])
|
@@ -127,6 +128,7 @@ It is invalid to create a new '#{@relation}' relation when one already exists, a
|
|
127
128
|
else
|
128
129
|
if nonexistent_id == :create
|
129
130
|
new_record = association_klass.new(lookup_key => attributes[:id])
|
131
|
+
new_record.assign_attributes(attributes)
|
130
132
|
self.send("#{association_name}=", new_record)
|
131
133
|
else
|
132
134
|
raise_nested_attributes_record_not_found!(association_name, attributes[:id])
|