tapioca 0.13.0 → 0.13.1
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: d49ca562ccbe7a00137e647a6e96499d6699b3c4c0d7d29f513a19d32fd17cd1
|
|
4
|
+
data.tar.gz: a7761368e37e779e7478892d81701bbc8096522103de6cd948b845e69d52d6d4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5ba58ce9b4be09cd647255a82ecac17049c946ba0d55dffc86160a69514f2e3c802b6f3b1627ddbbe92aba96e53a0d574191c1dfcb0a5af604e1294cebe6c9d4
|
|
7
|
+
data.tar.gz: c011df4fac4986b9cf33707059de3c86adbad54d26adcab75f949293f2a116bd5b1da5a1f5698ee70ecf497bdefe0fe7cfb03dc99b607eb78b4cd2f46aeffb60
|
|
@@ -661,7 +661,7 @@ module Tapioca
|
|
|
661
661
|
"::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, " \
|
|
662
662
|
"::ActiveSupport::Duration, T::Class[T.anything])"
|
|
663
663
|
array_type = if constant.try(:composite_primary_key?)
|
|
664
|
-
"T::Array[T::Array[#{id_types}]"
|
|
664
|
+
"T::Array[T::Array[#{id_types}]]"
|
|
665
665
|
else
|
|
666
666
|
"T::Array[#{id_types}]"
|
|
667
667
|
end
|
|
@@ -177,6 +177,18 @@ module Tapioca
|
|
|
177
177
|
|
|
178
178
|
private
|
|
179
179
|
|
|
180
|
+
sig { params(desc: Google::Protobuf::FieldDescriptor).returns(T::Boolean) }
|
|
181
|
+
def has_presence?(desc)
|
|
182
|
+
if desc.respond_to?(:has_presence?)
|
|
183
|
+
# This method is only defined in google-protobuf 3.26.0 and later
|
|
184
|
+
desc.has_presence?
|
|
185
|
+
else
|
|
186
|
+
# In older versions of the gem, the only way we can get this information is
|
|
187
|
+
# by checking if an instance of the class responds to the expected method
|
|
188
|
+
T.unsafe(constant.allocate).respond_to?("has_#{desc.name}?")
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
|
|
180
192
|
sig { params(klass: RBI::Scope, names: String).void }
|
|
181
193
|
def create_type_members(klass, *names)
|
|
182
194
|
klass.create_extend("T::Generic")
|
|
@@ -302,7 +314,7 @@ module Tapioca
|
|
|
302
314
|
return_type: "void",
|
|
303
315
|
)
|
|
304
316
|
|
|
305
|
-
if
|
|
317
|
+
if has_presence?(desc)
|
|
306
318
|
klass.create_method(
|
|
307
319
|
"has_#{field.name}?",
|
|
308
320
|
return_type: "Object",
|
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.13.
|
|
4
|
+
version: 0.13.1
|
|
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-03-
|
|
14
|
+
date: 2024-03-27 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: bundler
|
|
@@ -288,7 +288,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
288
288
|
- !ruby/object:Gem::Version
|
|
289
289
|
version: '0'
|
|
290
290
|
requirements: []
|
|
291
|
-
rubygems_version: 3.5.
|
|
291
|
+
rubygems_version: 3.5.7
|
|
292
292
|
signing_key:
|
|
293
293
|
specification_version: 4
|
|
294
294
|
summary: A Ruby Interface file generator for gems, core types and the Ruby standard
|