tapioca 0.11.16 → 0.11.17
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: 8a74fea1cf7f8de26296fa1fb617362cceac2f800740cfaac4e95b8b0106dfc9
|
4
|
+
data.tar.gz: 911ce69b722d3b30d07f2806ae155e0c390d015eea45ba85bf69c0796e6b5bf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fa1c5dcd97eee61f4385ba685c8f0b7e9290bc9a79822bdf46dcbe681b7b40bcef256cf8a293911b4bcbcb39ea325b1280da1eabbfde069d6d21161d1a6a6b0
|
7
|
+
data.tar.gz: b7d3e1b1e0341bd8b835daa3f4a405271a97376eca922ea46a5680b7d388560426819d77ea9b64623f91deb68d76548372b78488d626386f5cfb35ca6531934b
|
@@ -224,7 +224,6 @@ module Tapioca
|
|
224
224
|
def create_aliased_fetch_by_methods(field, klass)
|
225
225
|
type, _ = Helpers::ActiveRecordColumnTypeHelper.new(constant).type_for(field.alias_name.to_s)
|
226
226
|
multi_type = type.delete_prefix("T.nilable(").delete_suffix(")").delete_prefix("::")
|
227
|
-
length = field.key_fields.length
|
228
227
|
suffix = field.send(:fetch_method_suffix)
|
229
228
|
|
230
229
|
parameters = field.key_fields.map do |arg|
|
@@ -238,14 +237,12 @@ module Tapioca
|
|
238
237
|
return_type: type,
|
239
238
|
)
|
240
239
|
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
)
|
248
|
-
end
|
240
|
+
klass.create_method(
|
241
|
+
"fetch_multi_#{suffix}",
|
242
|
+
class_method: true,
|
243
|
+
parameters: [create_param("keys", type: "T::Enumerable[T.untyped]")],
|
244
|
+
return_type: COLLECTION_TYPE.call(multi_type),
|
245
|
+
)
|
249
246
|
end
|
250
247
|
end
|
251
248
|
end
|
@@ -26,9 +26,9 @@ module Tapioca
|
|
26
26
|
end
|
27
27
|
|
28
28
|
prepare = argument.prepare
|
29
|
-
prepare_method = if prepare
|
29
|
+
prepare_method = if prepare.is_a?(Symbol) || prepare.is_a?(String)
|
30
30
|
if constant.respond_to?(prepare)
|
31
|
-
constant.method(prepare)
|
31
|
+
constant.method(prepare.to_sym)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
data/lib/tapioca/gem/pipeline.rb
CHANGED
@@ -255,6 +255,23 @@ module Tapioca
|
|
255
255
|
def method_defined_by_forwardable_module?(method)
|
256
256
|
method.source_location&.first == Object.const_source_location(:Forwardable)&.first
|
257
257
|
end
|
258
|
+
|
259
|
+
sig { params(name: String).returns(T::Boolean) }
|
260
|
+
def has_aliased_namespace?(name)
|
261
|
+
name_parts = name.split("::")
|
262
|
+
name_parts.pop # drop the constant name, leaving just the namespace
|
263
|
+
|
264
|
+
name_parts.each_with_object([]) do |name_part, namespaces|
|
265
|
+
namespaces << "#{namespaces.last}::#{name_part}".delete_prefix("::")
|
266
|
+
end.any? do |namespace|
|
267
|
+
constant = constantize(namespace)
|
268
|
+
next unless Module === constant
|
269
|
+
|
270
|
+
# If the constant name doesn't match the namespace,
|
271
|
+
# the namespace must contain an alias
|
272
|
+
name_of(constant) != namespace
|
273
|
+
end
|
274
|
+
end
|
258
275
|
end
|
259
276
|
end
|
260
277
|
end
|
data/lib/tapioca/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tapioca
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ufuk Kayserilioglu
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2024-01-
|
14
|
+
date: 2024-01-15 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|