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: ca262e237c92c19f98aa14f5130ab052ed640779
4
- data.tar.gz: 8de6a7ad83c263f570a0400de578f3bc0502bcdc
3
+ metadata.gz: ec3d8fcdf3ca69fc5dee0187426672f42dac4615
4
+ data.tar.gz: 00036b9d96ffd71fca77f98a0ff44561b48f0520
5
5
  SHA512:
6
- metadata.gz: aa177283b04f1598a8e0dba06b37c62f2b446c808cca7cb86e8781312d83eb4d453ab0e3506903f0db7294a926ee03f3c06709c80d1bec217abd6a2f6987792b
7
- data.tar.gz: 60c2b434cad91e80d244f077f3fa95b884c68e1fa3d45667eccf94fcc1be7e109c87b96de19d69ef92d99e0413099b6263d41597e70a1b34da9c9edf0cb95229
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])
@@ -1,3 +1,3 @@
1
1
  module NestedAttributeReassignable
2
- VERSION = "0.6.4"
2
+ VERSION = "0.6.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nested_attribute_reassignable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond