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: 8695b3c4b636d2021926bf0c9c2e24214f187a51932082f2d707de39c77b7c1c
4
- data.tar.gz: 88a4e945bfd61b5b18e4abec1a4fa985b3e8417b6f37d333d56ae7dd77323f22
3
+ metadata.gz: 7cd663ae85d93ae01a2e4b42daa3870976b10de692ed58bed169016b051a2e42
4
+ data.tar.gz: 6d39aa14b9f2510eea4bbd67d8c0fd66eb9cc27818c02cdc14443187ad25e1e4
5
5
  SHA512:
6
- metadata.gz: 388d30a2d63a7300c8c10f6b3a8c1d84d8f32fdf699e937409e173f881fa06057f8be52904625c292f7081eb67d3ff7ed58d0eceff6708e3a8d7f7eb2ef70a1b
7
- data.tar.gz: 8eeab3c0cc6465d334556892c77bd353cda98a032fa5e42650af3cb553ced879a4d62b1fc46b76f37bad29997b5abc872d900bfd746a1ff66006a26285429be8
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: "T::Array[StoreModel::Model]"
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(T::Array[StoreModel::Model], " \
154
+ type: "T.nilable(T.any(#{array_type}, " \
152
155
  "T::Array[T::Hash[T.untyped, T.untyped]]))")],
153
- return_type: "T::Array[StoreModel::Model]"
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: array_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: array_type
199
+ return_type: nilable_array_type
196
200
  )
197
201
  end
198
202
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TapiocaDslCompilerStoreModel
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tapioca_dsl_compiler_store_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - speria-jp