object_attorney 2.6.11 → 2.6.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
NjA1MTMzODdmNjY3M2I2NGFiZjEwNWEzYmMxN2Y5NDJkZWRkNDMyOQ==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
ZTg0ZmJiMGNiMGNkMDNiNjFiOGY5YmNlYWY5NDRmYzkxYWNkYTdmZQ==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
ZmQ5MDA2ZDk4ZGUxOThkYTM3ZmFjZmQyNWYwMGZjZDU3Yzk3MzJjMDI2NTE3
|
|
10
|
+
MDkzYWY2YzljZWUzZGQ2YjE4MDljYWNjZmRjYzY2MjA5NzI5MzRjYmEyZmNm
|
|
11
|
+
YmJhYzg4NTdhOWI3MDBiZWRhNzQ1NWRiZTQ2YWI2ZDAzZTliYjI=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
MGU2NTJjODU0Y2NiODM2OGFlNWQ1MTJhMGU3MWI0MjdhMDViOTc3ZTQwYzU2
|
|
14
|
+
MWQ1YjBkODI0YTMyM2VmYzlmM2M1YThlNTRlNzQ2YzBjYzM5ZjMzNDFjMmFh
|
|
15
|
+
YjJiMjIyNjRkZTk2OTEzZDEyOTZmYmJkNDkzMTE2ZTc4MDcyMWY=
|
|
@@ -64,8 +64,12 @@ module ObjectAttorney
|
|
|
64
64
|
|
|
65
65
|
def get_attributes_for_existing(nested_object_name, existing_nested_object)
|
|
66
66
|
attributes = send("#{nested_object_name}_attributes")
|
|
67
|
-
|
|
68
|
-
attributes.present?
|
|
67
|
+
|
|
68
|
+
if attributes.present?
|
|
69
|
+
(attributes.values.select { |x| x[:id].to_i == existing_nested_object.id }.first || {}).symbolize_keys
|
|
70
|
+
else
|
|
71
|
+
{}
|
|
72
|
+
end
|
|
69
73
|
end
|
|
70
74
|
|
|
71
75
|
private #################### PRIVATE METHODS DOWN BELOW ######################
|
|
@@ -152,6 +156,7 @@ module ObjectAttorney
|
|
|
152
156
|
end
|
|
153
157
|
|
|
154
158
|
def build_nested_object(nested_object_name, attributes = {})
|
|
159
|
+
attributes = attributes.symbolize_keys
|
|
155
160
|
reflection = self.class.reflect_on_association(nested_object_name)
|
|
156
161
|
|
|
157
162
|
return nil if reflection.options[:new_records] == false
|