object_attorney 2.6.9 → 2.6.10
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
|
+
NGQ1MTE1YzQwMDc3MWRmMmJjZjQ3Y2IwZDRmMWE0ZmY5ODRiNjg1NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGE1ODliODdjZTRjNjkwYTM2ZDljZjRhYTk4OTA3NmRiZWI1ZGI3MA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjJmYThhYTg2MmRmYzkyNmJiYTdlNDg3NGQ1Mzc5ZGQwNTE0YjMyZDM1MzM2
|
10
|
+
OTNhYzNhN2JjODc5MmUwNWQ5MjNiMWI4NTE1Zjg0YTRmMjViMmE1ODU5YWMz
|
11
|
+
OWJlYjI3Njc1ODgwNTlmNWZmOTM2MmNhMDJiOGExMGFiYWNiZTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZGIxM2EyM2MyMGViYTlmNDgzODU3MTQ3MDE3YWUyNjYyZjMyMWJmODc0ODc5
|
14
|
+
NDE4YzBjNDdhZTkzZWZkOTUwMzY5NTA2MDQ3MDgzNTE0YzJiNzA3MTE4Mzdh
|
15
|
+
NTQ5YmYxNWViYWFkMDFjYjQxYjAwODMwNTcyMDUxMmJmNzZlYWI=
|
@@ -154,7 +154,7 @@ module ObjectAttorney
|
|
154
154
|
def build_nested_object(nested_object_name, attributes = {})
|
155
155
|
reflection = self.class.reflect_on_association(nested_object_name)
|
156
156
|
|
157
|
-
return nil if reflection.options[:
|
157
|
+
return nil if reflection.options[:new_records] == false
|
158
158
|
|
159
159
|
if can_represented_object_build_nested?(reflection, nested_object_name)
|
160
160
|
new_nested_object = build_from_represented_object(reflection, nested_object_name)
|
@@ -199,7 +199,7 @@ module ObjectAttorney
|
|
199
199
|
def existing_nested_objects(nested_object_name)
|
200
200
|
nested_relection = self.class.reflect_on_association(nested_object_name)
|
201
201
|
|
202
|
-
return [] if nested_relection.options[:
|
202
|
+
return [] if nested_relection.options[:existing_records] == false
|
203
203
|
|
204
204
|
existing = represented_object.nil? ? (nested_relection.klass.try(:all) || []) : (represented_object.send(nested_object_name) || (nested_relection.has_many? ? [] : nil))
|
205
205
|
|