tapioca_dsl_compiler_store_model 0.1.2 → 0.1.3
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,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cd663ae85d93ae01a2e4b42daa3870976b10de692ed58bed169016b051a2e42
|
4
|
+
data.tar.gz: 6d39aa14b9f2510eea4bbd67d8c0fd66eb9cc27818c02cdc14443187ad25e1e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d945c99a1571c75eda1f7f1f6d01a8c82ebcda9a4c8dc3cdf677cff9daebed3d2725bacee5dc25e71f8cf85d7c2b7917a0ae124fa6191372c5ccea7484233c4
|
7
|
+
data.tar.gz: 2f433c5753cd670ed30c51f49c99af4926411015167679bb0d7644f646fe3de0b0e069f3d60fd8009e6fa2a94f9c9d289010d915410051856832eae967c473a6
|
@@ -140,17 +140,20 @@ module Tapioca
|
|
140
140
|
sig { params(mod: T.untyped, attribute_name: String).void }
|
141
141
|
def create_one_of_array_methods(mod, attribute_name)
|
142
142
|
# OneOf array types are dynamically resolved
|
143
|
+
array_type = "T::Array[StoreModel::Model]"
|
144
|
+
nilable_array_type = "T.nilable(#{array_type})"
|
145
|
+
|
143
146
|
mod.create_method(
|
144
147
|
attribute_name,
|
145
|
-
return_type:
|
148
|
+
return_type: nilable_array_type
|
146
149
|
)
|
147
150
|
|
148
151
|
mod.create_method(
|
149
152
|
"#{attribute_name}=",
|
150
153
|
parameters: [create_param("value",
|
151
|
-
type: "T.nilable(T.any(
|
154
|
+
type: "T.nilable(T.any(#{array_type}, " \
|
152
155
|
"T::Array[T::Hash[T.untyped, T.untyped]]))")],
|
153
|
-
return_type:
|
156
|
+
return_type: nilable_array_type
|
154
157
|
)
|
155
158
|
end
|
156
159
|
|
@@ -181,10 +184,11 @@ module Tapioca
|
|
181
184
|
def create_many_store_model_methods(mod, attribute_name, model_klass)
|
182
185
|
return_type = model_klass.name
|
183
186
|
array_type = "T::Array[#{return_type}]"
|
187
|
+
nilable_array_type = "T.nilable(#{array_type})"
|
184
188
|
|
185
189
|
mod.create_method(
|
186
190
|
attribute_name,
|
187
|
-
return_type:
|
191
|
+
return_type: nilable_array_type
|
188
192
|
)
|
189
193
|
|
190
194
|
mod.create_method(
|
@@ -192,7 +196,7 @@ module Tapioca
|
|
192
196
|
parameters: [create_param("value",
|
193
197
|
type: "T.nilable(T.any(#{array_type}, " \
|
194
198
|
"T::Array[T::Hash[T.untyped, T.untyped]]))")],
|
195
|
-
return_type:
|
199
|
+
return_type: nilable_array_type
|
196
200
|
)
|
197
201
|
end
|
198
202
|
end
|