sorbet-rails 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/lib/sorbet-rails/active_record_rbi_formatter.rb +8 -2
- data/lib/sorbet-rails/model_plugins/active_record_querying.rb +28 -1
- data/lib/sorbet-rails/model_plugins/active_storage_methods.rb +1 -1
- data/lib/sorbet-rails/model_utils.rb +1 -1
- data/sorbet-rails.gemspec +1 -1
- data/spec/generators/sorbet_test_cases.rb +16 -8
- data/spec/support/v5.0/Gemfile.lock +2 -2
- data/spec/support/v5.0/sorbet_test_cases.rb +16 -8
- data/spec/support/v5.1/Gemfile.lock +2 -2
- data/spec/support/v5.1/sorbet_test_cases.rb +16 -8
- data/spec/support/v5.2/Gemfile.lock +2 -2
- data/spec/support/v5.2/sorbet_test_cases.rb +16 -8
- data/spec/support/v6.0/Gemfile.lock +2 -2
- data/spec/support/v6.0/sorbet_test_cases.rb +16 -8
- data/spec/test_data/v5.0/expected_active_record_base.rbi +2 -2
- data/spec/test_data/v5.0/expected_active_record_relation.rbi +2 -2
- data/spec/test_data/v5.0/expected_headmaster.rbi +24 -0
- data/spec/test_data/v5.0/expected_internal_metadata.rbi +24 -0
- data/spec/test_data/v5.0/expected_potion.rbi +24 -0
- data/spec/test_data/v5.0/expected_robe.rbi +24 -0
- data/spec/test_data/v5.0/expected_schema_migration.rbi +24 -0
- data/spec/test_data/v5.0/expected_school.rbi +24 -0
- data/spec/test_data/v5.0/expected_spell.rbi +24 -0
- data/spec/test_data/v5.0/expected_spell/habtm_spell_books.rbi +24 -0
- data/spec/test_data/v5.0/expected_spell_book.rbi +24 -0
- data/spec/test_data/v5.0/expected_spell_book/habtm_spells.rbi +24 -0
- data/spec/test_data/v5.0/expected_squib.rbi +24 -0
- data/spec/test_data/v5.0/expected_subject.rbi +24 -0
- data/spec/test_data/v5.0/expected_subject/habtm_wizards.rbi +24 -0
- data/spec/test_data/v5.0/expected_wand.rbi +24 -0
- data/spec/test_data/v5.0/expected_wizard.rbi +24 -0
- data/spec/test_data/v5.0/expected_wizard/habtm_subjects.rbi +24 -0
- data/spec/test_data/v5.0/expected_wizard_wo_spellbook.rbi +24 -0
- data/spec/test_data/v5.1/expected_active_record_base.rbi +2 -2
- data/spec/test_data/v5.1/expected_active_record_relation.rbi +2 -2
- data/spec/test_data/v5.1/expected_headmaster.rbi +24 -0
- data/spec/test_data/v5.1/expected_internal_metadata.rbi +24 -0
- data/spec/test_data/v5.1/expected_potion.rbi +24 -0
- data/spec/test_data/v5.1/expected_robe.rbi +24 -0
- data/spec/test_data/v5.1/expected_schema_migration.rbi +24 -0
- data/spec/test_data/v5.1/expected_school.rbi +24 -0
- data/spec/test_data/v5.1/expected_spell.rbi +24 -0
- data/spec/test_data/v5.1/expected_spell/habtm_spell_books.rbi +24 -0
- data/spec/test_data/v5.1/expected_spell_book.rbi +24 -0
- data/spec/test_data/v5.1/expected_spell_book/habtm_spells.rbi +24 -0
- data/spec/test_data/v5.1/expected_squib.rbi +24 -0
- data/spec/test_data/v5.1/expected_subject.rbi +24 -0
- data/spec/test_data/v5.1/expected_subject/habtm_wizards.rbi +24 -0
- data/spec/test_data/v5.1/expected_wand.rbi +24 -0
- data/spec/test_data/v5.1/expected_wizard.rbi +24 -0
- data/spec/test_data/v5.1/expected_wizard/habtm_subjects.rbi +24 -0
- data/spec/test_data/v5.1/expected_wizard_wo_spellbook.rbi +24 -0
- data/spec/test_data/v5.2/expected_active_record_base.rbi +2 -2
- data/spec/test_data/v5.2/expected_active_record_relation.rbi +2 -2
- data/spec/test_data/v5.2/expected_attachment.rbi +24 -0
- data/spec/test_data/v5.2/expected_blob.rbi +24 -0
- data/spec/test_data/v5.2/expected_headmaster.rbi +24 -0
- data/spec/test_data/v5.2/expected_internal_metadata.rbi +24 -0
- data/spec/test_data/v5.2/expected_potion.rbi +24 -0
- data/spec/test_data/v5.2/expected_robe.rbi +24 -0
- data/spec/test_data/v5.2/expected_schema_migration.rbi +24 -0
- data/spec/test_data/v5.2/expected_school.rbi +24 -0
- data/spec/test_data/v5.2/expected_spell.rbi +24 -0
- data/spec/test_data/v5.2/expected_spell/habtm_spell_books.rbi +24 -0
- data/spec/test_data/v5.2/expected_spell_book.rbi +24 -0
- data/spec/test_data/v5.2/expected_spell_book/habtm_spells.rbi +24 -0
- data/spec/test_data/v5.2/expected_squib.rbi +24 -0
- data/spec/test_data/v5.2/expected_subject.rbi +24 -0
- data/spec/test_data/v5.2/expected_subject/habtm_wizards.rbi +24 -0
- data/spec/test_data/v5.2/expected_wand.rbi +24 -0
- data/spec/test_data/v5.2/expected_wizard.rbi +24 -0
- data/spec/test_data/v5.2/expected_wizard/habtm_subjects.rbi +24 -0
- data/spec/test_data/v5.2/expected_wizard_wo_spellbook.rbi +24 -0
- data/spec/test_data/v6.0/expected_active_record_base.rbi +2 -2
- data/spec/test_data/v6.0/expected_active_record_relation.rbi +10 -10
- data/spec/test_data/v6.0/expected_attachment.rbi +24 -0
- data/spec/test_data/v6.0/expected_blob.rbi +74 -38
- data/spec/test_data/v6.0/expected_headmaster.rbi +24 -0
- data/spec/test_data/v6.0/expected_internal_metadata.rbi +24 -0
- data/spec/test_data/v6.0/expected_potion.rbi +24 -0
- data/spec/test_data/v6.0/expected_robe.rbi +24 -0
- data/spec/test_data/v6.0/expected_routes.rbi +14 -7
- data/spec/test_data/v6.0/expected_schema_migration.rbi +24 -0
- data/spec/test_data/v6.0/expected_school.rbi +24 -0
- data/spec/test_data/v6.0/expected_spell.rbi +24 -0
- data/spec/test_data/v6.0/expected_spell/habtm_spell_books.rbi +24 -0
- data/spec/test_data/v6.0/expected_spell_book.rbi +119 -53
- data/spec/test_data/v6.0/expected_spell_book/habtm_spells.rbi +24 -0
- data/spec/test_data/v6.0/expected_squib.rbi +346 -100
- data/spec/test_data/v6.0/expected_subject.rbi +24 -0
- data/spec/test_data/v6.0/expected_subject/habtm_wizards.rbi +24 -0
- data/spec/test_data/v6.0/expected_wand.rbi +128 -56
- data/spec/test_data/v6.0/expected_wizard.rbi +346 -100
- data/spec/test_data/v6.0/expected_wizard/habtm_subjects.rbi +24 -0
- data/spec/test_data/v6.0/expected_wizard_wo_spellbook.rbi +346 -100
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c81291953020b0718bba6afbbd60cf3e1d5a54ea08a85298357d0b46302437e8
|
4
|
+
data.tar.gz: 5498a890ee281ddb68b3ca26e1656c5a48b2dddd9eee925383d5b5f90da7bdd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f589fd032bea40225212f4375d93b07cea5ae5a5b1a743c763cd33b767458c552b50f88f11ff6fd3c391dc5ffd2f77ffcb08d34c5a27946d3ee9d5bbcd8fbffa
|
7
|
+
data.tar.gz: 06a31971aa26f770322cc0ee3700607ad0da700851ae24dd2424605420cfe0552bad8b504509fd887af91ecced25defcdf597bd965c68933fe22eb3daf2bc960
|
data/.travis.yml
CHANGED
@@ -85,11 +85,18 @@ class SorbetRails::ActiveRecordRbiFormatter
|
|
85
85
|
# parameters than the ones defined by `create_elem_specific_query_methods` so
|
86
86
|
# we need to match the signatures in that conflicting rbi.
|
87
87
|
build_methods = %w(new build create create!)
|
88
|
+
# This needs to match the generated method signature in activerecord.rbi and
|
89
|
+
# in Rails 5.0 and 5.1 the param is a splat.
|
90
|
+
if Rails.version =~ /^5\./
|
91
|
+
build_param = Parameter.new("*args", type: "T.untyped")
|
92
|
+
else
|
93
|
+
build_param = Parameter.new("attributes", type: "T.untyped", default: 'nil')
|
94
|
+
end
|
88
95
|
build_methods.each do |build_method|
|
89
96
|
class_rbi.create_method(
|
90
97
|
build_method,
|
91
98
|
parameters: [
|
92
|
-
|
99
|
+
build_param,
|
93
100
|
Parameter.new(
|
94
101
|
"&block",
|
95
102
|
type: "T.nilable(T.proc.params(object: Elem).void)",
|
@@ -264,7 +271,6 @@ class SorbetRails::ActiveRecordRbiFormatter
|
|
264
271
|
],
|
265
272
|
return_type: "T::Enumerator[#{inner_type}]",
|
266
273
|
class_method: class_method,
|
267
|
-
override: true,
|
268
274
|
)
|
269
275
|
end
|
270
276
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# typed:
|
1
|
+
# typed: strict
|
2
2
|
require ('sorbet-rails/model_plugins/base')
|
3
3
|
class SorbetRails::ModelPlugins::ActiveRecordQuerying < SorbetRails::ModelPlugins::Base
|
4
4
|
|
@@ -49,5 +49,32 @@ class SorbetRails::ModelPlugins::ActiveRecordQuerying < SorbetRails::ModelPlugin
|
|
49
49
|
],
|
50
50
|
builtin_query_method: true,
|
51
51
|
)
|
52
|
+
|
53
|
+
# These are technically "query methods" but they aren't chainable so instead of
|
54
|
+
# adding conditionals to `add_relation_query_method` to handle this we'll just
|
55
|
+
# handle them here.
|
56
|
+
relation_module_rbi = root.create_module(self.model_query_methods_returning_relation_module_name)
|
57
|
+
create_in_batches_method(relation_module_rbi, inner_type: self.model_relation_class_name)
|
58
|
+
|
59
|
+
assoc_relation_module_rbi = root.create_module(self.model_query_methods_returning_assoc_relation_module_name)
|
60
|
+
create_in_batches_method(assoc_relation_module_rbi, inner_type: self.model_assoc_relation_class_name)
|
61
|
+
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
sig { params(root: Parlour::RbiGenerator::Namespace, inner_type: String).void }
|
66
|
+
def create_in_batches_method(root, inner_type:)
|
67
|
+
root.create_method(
|
68
|
+
"in_batches",
|
69
|
+
parameters: [
|
70
|
+
Parameter.new("of:", type: "T.nilable(Integer)", default: "1000"),
|
71
|
+
Parameter.new("start:", type: "T.nilable(Integer)", default: "nil"),
|
72
|
+
Parameter.new("finish:", type: "T.nilable(Integer)", default: "nil"),
|
73
|
+
Parameter.new("load:", type: "T.nilable(T::Boolean)", default: "false"),
|
74
|
+
Parameter.new("error_on_ignore:", type: "T.nilable(T::Boolean)", default: "nil"),
|
75
|
+
Parameter.new("&block", type: "T.nilable(T.proc.params(e: #{inner_type}).void)"),
|
76
|
+
],
|
77
|
+
return_type: "T::Enumerable[#{inner_type}]",
|
78
|
+
)
|
52
79
|
end
|
53
80
|
end
|
@@ -52,7 +52,7 @@ class SorbetRails::ModelPlugins::ActiveStorageMethods < SorbetRails::ModelPlugin
|
|
52
52
|
mod.create_method(
|
53
53
|
"#{assoc_name}=",
|
54
54
|
parameters: [
|
55
|
-
Parameter.new('
|
55
|
+
Parameter.new('attachables', type: 'T.untyped')
|
56
56
|
],
|
57
57
|
return_type: 'T.untyped'
|
58
58
|
)
|
@@ -106,7 +106,7 @@ module SorbetRails::ModelUtils
|
|
106
106
|
# model. However, in Rails 5 query methods that come from scopes or enums
|
107
107
|
# get overridden in hidden-definitions so we need to explicitly define them
|
108
108
|
# on the model and relation classes.
|
109
|
-
if builtin_query_method
|
109
|
+
if builtin_query_method
|
110
110
|
relation_module_rbi = root.create_module(self.model_query_methods_returning_relation_module_name)
|
111
111
|
relation_module_rbi.create_method(
|
112
112
|
method_name,
|
data/sorbet-rails.gemspec
CHANGED
@@ -63,6 +63,8 @@ Wizard.find_each { |w| T.assert_type!(w, Wizard) }
|
|
63
63
|
T.assert_type!(Wizard.find_each, T::Enumerator[Wizard])
|
64
64
|
Wizard.find_in_batches { |w| T.assert_type!(w, T::Array[Wizard]) }
|
65
65
|
T.assert_type!(Wizard.find_in_batches, T::Enumerator[T::Array[Wizard]])
|
66
|
+
Wizard.in_batches { |w| T.assert_type!(w, Wizard::ActiveRecord_Relation) }
|
67
|
+
T.assert_type!(Wizard.in_batches, T::Enumerable[Wizard::ActiveRecord_Relation])
|
66
68
|
# T.assert_type!(Wizard.destroy_all, T::Array[Wizard]) # Ignored until we add support
|
67
69
|
T.assert_type!(Wizard.any?, T::Boolean)
|
68
70
|
T.assert_type!(Wizard.many?, T::Boolean)
|
@@ -118,6 +120,8 @@ Wizard.all.find_each { |w| T.assert_type!(w, Wizard) }
|
|
118
120
|
T.assert_type!(Wizard.all.find_each, T::Enumerator[Wizard])
|
119
121
|
Wizard.all.find_in_batches { |w| T.assert_type!(w, T::Array[Wizard]) }
|
120
122
|
T.assert_type!(Wizard.all.find_in_batches, T::Enumerator[T::Array[Wizard]])
|
123
|
+
Wizard.all.in_batches { |w| T.assert_type!(w, Wizard::ActiveRecord_Relation) }
|
124
|
+
T.assert_type!(Wizard.all.in_batches, T::Enumerable[Wizard::ActiveRecord_Relation])
|
121
125
|
# T.assert_type!(Wizard.all.destroy_all, T::Array[Wizard]) # Ignored until we add support
|
122
126
|
T.assert_type!(Wizard.all.any?, T::Boolean)
|
123
127
|
T.assert_type!(Wizard.all.many?, T::Boolean)
|
@@ -176,10 +180,12 @@ T.assert_type!(spell_books.create!(name: 'Fantastic Beasts') { |s| T.assert_type
|
|
176
180
|
T.assert_type!(spell_books.first_or_create(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
177
181
|
T.assert_type!(spell_books.first_or_create!(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
178
182
|
T.assert_type!(spell_books.first_or_initialize { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
+
spell_books.find_each { |s| T.assert_type!(s, SpellBook) }
|
184
|
+
T.assert_type!(spell_books.find_each, T::Enumerator[SpellBook])
|
185
|
+
spell_books.find_in_batches { |s| T.assert_type!(s, T::Array[SpellBook]) }
|
186
|
+
T.assert_type!(spell_books.find_in_batches, T::Enumerator[T::Array[SpellBook]])
|
187
|
+
spell_books.in_batches { |s| T.assert_type!(s, SpellBook::ActiveRecord_AssociationRelation) }
|
188
|
+
T.assert_type!(spell_books.in_batches, T::Enumerable[SpellBook::ActiveRecord_AssociationRelation])
|
183
189
|
# T.assert_type!(spell_books.destroy_all, T::Array[SpellBook]) # Ignored until we add support
|
184
190
|
T.assert_type!(spell_books.any?, T::Boolean)
|
185
191
|
T.assert_type!(spell_books.many?, T::Boolean)
|
@@ -246,10 +252,12 @@ T.assert_type!(spell_books_query.create!(name: 'Fantastic Beasts') { |s| T.asser
|
|
246
252
|
T.assert_type!(spell_books_query.first_or_create(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
247
253
|
T.assert_type!(spell_books_query.first_or_create!(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
248
254
|
T.assert_type!(spell_books_query.first_or_initialize { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
255
|
+
spell_books_query.find_each { |s| T.assert_type!(s, SpellBook) }
|
256
|
+
T.assert_type!(spell_books_query.find_each, T::Enumerator[SpellBook])
|
257
|
+
spell_books_query.find_in_batches { |s| T.assert_type!(s, T::Array[SpellBook]) }
|
258
|
+
T.assert_type!(spell_books_query.find_in_batches, T::Enumerator[T::Array[SpellBook]])
|
259
|
+
spell_books_query.in_batches { |s| T.assert_type!(s, SpellBook::ActiveRecord_AssociationRelation) }
|
260
|
+
T.assert_type!(spell_books_query.in_batches, T::Enumerable[SpellBook::ActiveRecord_AssociationRelation])
|
253
261
|
# T.assert_type!(spell_books_query.destroy_all, T::Array[SpellBook]) # Ignored until we add support
|
254
262
|
T.assert_type!(spell_books_query.any?, T::Boolean)
|
255
263
|
T.assert_type!(spell_books_query.many?, T::Boolean)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../../..
|
3
3
|
specs:
|
4
|
-
sorbet-rails (0.6.
|
4
|
+
sorbet-rails (0.6.5)
|
5
5
|
method_source (>= 0.9.2)
|
6
6
|
parlour (~> 2.0)
|
7
7
|
parser (>= 2.7)
|
@@ -116,7 +116,7 @@ GEM
|
|
116
116
|
safe_type (1.1.1)
|
117
117
|
sorbet (0.5.5480)
|
118
118
|
sorbet-static (= 0.5.5480)
|
119
|
-
sorbet-coerce (0.2.
|
119
|
+
sorbet-coerce (0.2.7)
|
120
120
|
polyfill (~> 1.8)
|
121
121
|
safe_type (~> 1.1, >= 1.1.1)
|
122
122
|
sorbet (>= 0.4.4704)
|
@@ -63,6 +63,8 @@ Wizard.find_each { |w| T.assert_type!(w, Wizard) }
|
|
63
63
|
T.assert_type!(Wizard.find_each, T::Enumerator[Wizard])
|
64
64
|
Wizard.find_in_batches { |w| T.assert_type!(w, T::Array[Wizard]) }
|
65
65
|
T.assert_type!(Wizard.find_in_batches, T::Enumerator[T::Array[Wizard]])
|
66
|
+
Wizard.in_batches { |w| T.assert_type!(w, Wizard::ActiveRecord_Relation) }
|
67
|
+
T.assert_type!(Wizard.in_batches, T::Enumerable[Wizard::ActiveRecord_Relation])
|
66
68
|
# T.assert_type!(Wizard.destroy_all, T::Array[Wizard]) # Ignored until we add support
|
67
69
|
T.assert_type!(Wizard.any?, T::Boolean)
|
68
70
|
T.assert_type!(Wizard.many?, T::Boolean)
|
@@ -118,6 +120,8 @@ Wizard.all.find_each { |w| T.assert_type!(w, Wizard) }
|
|
118
120
|
T.assert_type!(Wizard.all.find_each, T::Enumerator[Wizard])
|
119
121
|
Wizard.all.find_in_batches { |w| T.assert_type!(w, T::Array[Wizard]) }
|
120
122
|
T.assert_type!(Wizard.all.find_in_batches, T::Enumerator[T::Array[Wizard]])
|
123
|
+
Wizard.all.in_batches { |w| T.assert_type!(w, Wizard::ActiveRecord_Relation) }
|
124
|
+
T.assert_type!(Wizard.all.in_batches, T::Enumerable[Wizard::ActiveRecord_Relation])
|
121
125
|
# T.assert_type!(Wizard.all.destroy_all, T::Array[Wizard]) # Ignored until we add support
|
122
126
|
T.assert_type!(Wizard.all.any?, T::Boolean)
|
123
127
|
T.assert_type!(Wizard.all.many?, T::Boolean)
|
@@ -176,10 +180,12 @@ T.assert_type!(spell_books.create!(name: 'Fantastic Beasts') { |s| T.assert_type
|
|
176
180
|
T.assert_type!(spell_books.first_or_create(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
177
181
|
T.assert_type!(spell_books.first_or_create!(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
178
182
|
T.assert_type!(spell_books.first_or_initialize { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
+
spell_books.find_each { |s| T.assert_type!(s, SpellBook) }
|
184
|
+
T.assert_type!(spell_books.find_each, T::Enumerator[SpellBook])
|
185
|
+
spell_books.find_in_batches { |s| T.assert_type!(s, T::Array[SpellBook]) }
|
186
|
+
T.assert_type!(spell_books.find_in_batches, T::Enumerator[T::Array[SpellBook]])
|
187
|
+
spell_books.in_batches { |s| T.assert_type!(s, SpellBook::ActiveRecord_AssociationRelation) }
|
188
|
+
T.assert_type!(spell_books.in_batches, T::Enumerable[SpellBook::ActiveRecord_AssociationRelation])
|
183
189
|
# T.assert_type!(spell_books.destroy_all, T::Array[SpellBook]) # Ignored until we add support
|
184
190
|
T.assert_type!(spell_books.any?, T::Boolean)
|
185
191
|
T.assert_type!(spell_books.many?, T::Boolean)
|
@@ -246,10 +252,12 @@ T.assert_type!(spell_books_query.create!(name: 'Fantastic Beasts') { |s| T.asser
|
|
246
252
|
T.assert_type!(spell_books_query.first_or_create(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
247
253
|
T.assert_type!(spell_books_query.first_or_create!(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
248
254
|
T.assert_type!(spell_books_query.first_or_initialize { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
255
|
+
spell_books_query.find_each { |s| T.assert_type!(s, SpellBook) }
|
256
|
+
T.assert_type!(spell_books_query.find_each, T::Enumerator[SpellBook])
|
257
|
+
spell_books_query.find_in_batches { |s| T.assert_type!(s, T::Array[SpellBook]) }
|
258
|
+
T.assert_type!(spell_books_query.find_in_batches, T::Enumerator[T::Array[SpellBook]])
|
259
|
+
spell_books_query.in_batches { |s| T.assert_type!(s, SpellBook::ActiveRecord_AssociationRelation) }
|
260
|
+
T.assert_type!(spell_books_query.in_batches, T::Enumerable[SpellBook::ActiveRecord_AssociationRelation])
|
253
261
|
# T.assert_type!(spell_books_query.destroy_all, T::Array[SpellBook]) # Ignored until we add support
|
254
262
|
T.assert_type!(spell_books_query.any?, T::Boolean)
|
255
263
|
T.assert_type!(spell_books_query.many?, T::Boolean)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../../..
|
3
3
|
specs:
|
4
|
-
sorbet-rails (0.6.
|
4
|
+
sorbet-rails (0.6.5)
|
5
5
|
method_source (>= 0.9.2)
|
6
6
|
parlour (~> 2.0)
|
7
7
|
parser (>= 2.7)
|
@@ -117,7 +117,7 @@ GEM
|
|
117
117
|
safe_type (1.1.1)
|
118
118
|
sorbet (0.5.5480)
|
119
119
|
sorbet-static (= 0.5.5480)
|
120
|
-
sorbet-coerce (0.2.
|
120
|
+
sorbet-coerce (0.2.7)
|
121
121
|
polyfill (~> 1.8)
|
122
122
|
safe_type (~> 1.1, >= 1.1.1)
|
123
123
|
sorbet (>= 0.4.4704)
|
@@ -63,6 +63,8 @@ Wizard.find_each { |w| T.assert_type!(w, Wizard) }
|
|
63
63
|
T.assert_type!(Wizard.find_each, T::Enumerator[Wizard])
|
64
64
|
Wizard.find_in_batches { |w| T.assert_type!(w, T::Array[Wizard]) }
|
65
65
|
T.assert_type!(Wizard.find_in_batches, T::Enumerator[T::Array[Wizard]])
|
66
|
+
Wizard.in_batches { |w| T.assert_type!(w, Wizard::ActiveRecord_Relation) }
|
67
|
+
T.assert_type!(Wizard.in_batches, T::Enumerable[Wizard::ActiveRecord_Relation])
|
66
68
|
# T.assert_type!(Wizard.destroy_all, T::Array[Wizard]) # Ignored until we add support
|
67
69
|
T.assert_type!(Wizard.any?, T::Boolean)
|
68
70
|
T.assert_type!(Wizard.many?, T::Boolean)
|
@@ -118,6 +120,8 @@ Wizard.all.find_each { |w| T.assert_type!(w, Wizard) }
|
|
118
120
|
T.assert_type!(Wizard.all.find_each, T::Enumerator[Wizard])
|
119
121
|
Wizard.all.find_in_batches { |w| T.assert_type!(w, T::Array[Wizard]) }
|
120
122
|
T.assert_type!(Wizard.all.find_in_batches, T::Enumerator[T::Array[Wizard]])
|
123
|
+
Wizard.all.in_batches { |w| T.assert_type!(w, Wizard::ActiveRecord_Relation) }
|
124
|
+
T.assert_type!(Wizard.all.in_batches, T::Enumerable[Wizard::ActiveRecord_Relation])
|
121
125
|
# T.assert_type!(Wizard.all.destroy_all, T::Array[Wizard]) # Ignored until we add support
|
122
126
|
T.assert_type!(Wizard.all.any?, T::Boolean)
|
123
127
|
T.assert_type!(Wizard.all.many?, T::Boolean)
|
@@ -176,10 +180,12 @@ T.assert_type!(spell_books.create!(name: 'Fantastic Beasts') { |s| T.assert_type
|
|
176
180
|
T.assert_type!(spell_books.first_or_create(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
177
181
|
T.assert_type!(spell_books.first_or_create!(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
178
182
|
T.assert_type!(spell_books.first_or_initialize { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
+
spell_books.find_each { |s| T.assert_type!(s, SpellBook) }
|
184
|
+
T.assert_type!(spell_books.find_each, T::Enumerator[SpellBook])
|
185
|
+
spell_books.find_in_batches { |s| T.assert_type!(s, T::Array[SpellBook]) }
|
186
|
+
T.assert_type!(spell_books.find_in_batches, T::Enumerator[T::Array[SpellBook]])
|
187
|
+
spell_books.in_batches { |s| T.assert_type!(s, SpellBook::ActiveRecord_AssociationRelation) }
|
188
|
+
T.assert_type!(spell_books.in_batches, T::Enumerable[SpellBook::ActiveRecord_AssociationRelation])
|
183
189
|
# T.assert_type!(spell_books.destroy_all, T::Array[SpellBook]) # Ignored until we add support
|
184
190
|
T.assert_type!(spell_books.any?, T::Boolean)
|
185
191
|
T.assert_type!(spell_books.many?, T::Boolean)
|
@@ -246,10 +252,12 @@ T.assert_type!(spell_books_query.create!(name: 'Fantastic Beasts') { |s| T.asser
|
|
246
252
|
T.assert_type!(spell_books_query.first_or_create(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
247
253
|
T.assert_type!(spell_books_query.first_or_create!(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
248
254
|
T.assert_type!(spell_books_query.first_or_initialize { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
255
|
+
spell_books_query.find_each { |s| T.assert_type!(s, SpellBook) }
|
256
|
+
T.assert_type!(spell_books_query.find_each, T::Enumerator[SpellBook])
|
257
|
+
spell_books_query.find_in_batches { |s| T.assert_type!(s, T::Array[SpellBook]) }
|
258
|
+
T.assert_type!(spell_books_query.find_in_batches, T::Enumerator[T::Array[SpellBook]])
|
259
|
+
spell_books_query.in_batches { |s| T.assert_type!(s, SpellBook::ActiveRecord_AssociationRelation) }
|
260
|
+
T.assert_type!(spell_books_query.in_batches, T::Enumerable[SpellBook::ActiveRecord_AssociationRelation])
|
253
261
|
# T.assert_type!(spell_books_query.destroy_all, T::Array[SpellBook]) # Ignored until we add support
|
254
262
|
T.assert_type!(spell_books_query.any?, T::Boolean)
|
255
263
|
T.assert_type!(spell_books_query.many?, T::Boolean)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../../..
|
3
3
|
specs:
|
4
|
-
sorbet-rails (0.6.
|
4
|
+
sorbet-rails (0.6.5)
|
5
5
|
method_source (>= 0.9.2)
|
6
6
|
parlour (~> 2.0)
|
7
7
|
parser (>= 2.7)
|
@@ -125,7 +125,7 @@ GEM
|
|
125
125
|
safe_type (1.1.1)
|
126
126
|
sorbet (0.5.5480)
|
127
127
|
sorbet-static (= 0.5.5480)
|
128
|
-
sorbet-coerce (0.2.
|
128
|
+
sorbet-coerce (0.2.7)
|
129
129
|
polyfill (~> 1.8)
|
130
130
|
safe_type (~> 1.1, >= 1.1.1)
|
131
131
|
sorbet (>= 0.4.4704)
|
@@ -63,6 +63,8 @@ Wizard.find_each { |w| T.assert_type!(w, Wizard) }
|
|
63
63
|
T.assert_type!(Wizard.find_each, T::Enumerator[Wizard])
|
64
64
|
Wizard.find_in_batches { |w| T.assert_type!(w, T::Array[Wizard]) }
|
65
65
|
T.assert_type!(Wizard.find_in_batches, T::Enumerator[T::Array[Wizard]])
|
66
|
+
Wizard.in_batches { |w| T.assert_type!(w, Wizard::ActiveRecord_Relation) }
|
67
|
+
T.assert_type!(Wizard.in_batches, T::Enumerable[Wizard::ActiveRecord_Relation])
|
66
68
|
# T.assert_type!(Wizard.destroy_all, T::Array[Wizard]) # Ignored until we add support
|
67
69
|
T.assert_type!(Wizard.any?, T::Boolean)
|
68
70
|
T.assert_type!(Wizard.many?, T::Boolean)
|
@@ -118,6 +120,8 @@ Wizard.all.find_each { |w| T.assert_type!(w, Wizard) }
|
|
118
120
|
T.assert_type!(Wizard.all.find_each, T::Enumerator[Wizard])
|
119
121
|
Wizard.all.find_in_batches { |w| T.assert_type!(w, T::Array[Wizard]) }
|
120
122
|
T.assert_type!(Wizard.all.find_in_batches, T::Enumerator[T::Array[Wizard]])
|
123
|
+
Wizard.all.in_batches { |w| T.assert_type!(w, Wizard::ActiveRecord_Relation) }
|
124
|
+
T.assert_type!(Wizard.all.in_batches, T::Enumerable[Wizard::ActiveRecord_Relation])
|
121
125
|
# T.assert_type!(Wizard.all.destroy_all, T::Array[Wizard]) # Ignored until we add support
|
122
126
|
T.assert_type!(Wizard.all.any?, T::Boolean)
|
123
127
|
T.assert_type!(Wizard.all.many?, T::Boolean)
|
@@ -176,10 +180,12 @@ T.assert_type!(spell_books.create!(name: 'Fantastic Beasts') { |s| T.assert_type
|
|
176
180
|
T.assert_type!(spell_books.first_or_create(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
177
181
|
T.assert_type!(spell_books.first_or_create!(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
178
182
|
T.assert_type!(spell_books.first_or_initialize { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
+
spell_books.find_each { |s| T.assert_type!(s, SpellBook) }
|
184
|
+
T.assert_type!(spell_books.find_each, T::Enumerator[SpellBook])
|
185
|
+
spell_books.find_in_batches { |s| T.assert_type!(s, T::Array[SpellBook]) }
|
186
|
+
T.assert_type!(spell_books.find_in_batches, T::Enumerator[T::Array[SpellBook]])
|
187
|
+
spell_books.in_batches { |s| T.assert_type!(s, SpellBook::ActiveRecord_AssociationRelation) }
|
188
|
+
T.assert_type!(spell_books.in_batches, T::Enumerable[SpellBook::ActiveRecord_AssociationRelation])
|
183
189
|
# T.assert_type!(spell_books.destroy_all, T::Array[SpellBook]) # Ignored until we add support
|
184
190
|
T.assert_type!(spell_books.any?, T::Boolean)
|
185
191
|
T.assert_type!(spell_books.many?, T::Boolean)
|
@@ -246,10 +252,12 @@ T.assert_type!(spell_books_query.create!(name: 'Fantastic Beasts') { |s| T.asser
|
|
246
252
|
T.assert_type!(spell_books_query.first_or_create(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
247
253
|
T.assert_type!(spell_books_query.first_or_create!(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
248
254
|
T.assert_type!(spell_books_query.first_or_initialize { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
255
|
+
spell_books_query.find_each { |s| T.assert_type!(s, SpellBook) }
|
256
|
+
T.assert_type!(spell_books_query.find_each, T::Enumerator[SpellBook])
|
257
|
+
spell_books_query.find_in_batches { |s| T.assert_type!(s, T::Array[SpellBook]) }
|
258
|
+
T.assert_type!(spell_books_query.find_in_batches, T::Enumerator[T::Array[SpellBook]])
|
259
|
+
spell_books_query.in_batches { |s| T.assert_type!(s, SpellBook::ActiveRecord_AssociationRelation) }
|
260
|
+
T.assert_type!(spell_books_query.in_batches, T::Enumerable[SpellBook::ActiveRecord_AssociationRelation])
|
253
261
|
# T.assert_type!(spell_books_query.destroy_all, T::Array[SpellBook]) # Ignored until we add support
|
254
262
|
T.assert_type!(spell_books_query.any?, T::Boolean)
|
255
263
|
T.assert_type!(spell_books_query.many?, T::Boolean)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../../..
|
3
3
|
specs:
|
4
|
-
sorbet-rails (0.6.
|
4
|
+
sorbet-rails (0.6.5)
|
5
5
|
method_source (>= 0.9.2)
|
6
6
|
parlour (~> 2.0)
|
7
7
|
parser (>= 2.7)
|
@@ -140,7 +140,7 @@ GEM
|
|
140
140
|
safe_type (1.1.1)
|
141
141
|
sorbet (0.5.5480)
|
142
142
|
sorbet-static (= 0.5.5480)
|
143
|
-
sorbet-coerce (0.2.
|
143
|
+
sorbet-coerce (0.2.7)
|
144
144
|
polyfill (~> 1.8)
|
145
145
|
safe_type (~> 1.1, >= 1.1.1)
|
146
146
|
sorbet (>= 0.4.4704)
|
@@ -63,6 +63,8 @@ Wizard.find_each { |w| T.assert_type!(w, Wizard) }
|
|
63
63
|
T.assert_type!(Wizard.find_each, T::Enumerator[Wizard])
|
64
64
|
Wizard.find_in_batches { |w| T.assert_type!(w, T::Array[Wizard]) }
|
65
65
|
T.assert_type!(Wizard.find_in_batches, T::Enumerator[T::Array[Wizard]])
|
66
|
+
Wizard.in_batches { |w| T.assert_type!(w, Wizard::ActiveRecord_Relation) }
|
67
|
+
T.assert_type!(Wizard.in_batches, T::Enumerable[Wizard::ActiveRecord_Relation])
|
66
68
|
# T.assert_type!(Wizard.destroy_all, T::Array[Wizard]) # Ignored until we add support
|
67
69
|
T.assert_type!(Wizard.any?, T::Boolean)
|
68
70
|
T.assert_type!(Wizard.many?, T::Boolean)
|
@@ -118,6 +120,8 @@ Wizard.all.find_each { |w| T.assert_type!(w, Wizard) }
|
|
118
120
|
T.assert_type!(Wizard.all.find_each, T::Enumerator[Wizard])
|
119
121
|
Wizard.all.find_in_batches { |w| T.assert_type!(w, T::Array[Wizard]) }
|
120
122
|
T.assert_type!(Wizard.all.find_in_batches, T::Enumerator[T::Array[Wizard]])
|
123
|
+
Wizard.all.in_batches { |w| T.assert_type!(w, Wizard::ActiveRecord_Relation) }
|
124
|
+
T.assert_type!(Wizard.all.in_batches, T::Enumerable[Wizard::ActiveRecord_Relation])
|
121
125
|
# T.assert_type!(Wizard.all.destroy_all, T::Array[Wizard]) # Ignored until we add support
|
122
126
|
T.assert_type!(Wizard.all.any?, T::Boolean)
|
123
127
|
T.assert_type!(Wizard.all.many?, T::Boolean)
|
@@ -176,10 +180,12 @@ T.assert_type!(spell_books.create!(name: 'Fantastic Beasts') { |s| T.assert_type
|
|
176
180
|
T.assert_type!(spell_books.first_or_create(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
177
181
|
T.assert_type!(spell_books.first_or_create!(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
178
182
|
T.assert_type!(spell_books.first_or_initialize { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
+
spell_books.find_each { |s| T.assert_type!(s, SpellBook) }
|
184
|
+
T.assert_type!(spell_books.find_each, T::Enumerator[SpellBook])
|
185
|
+
spell_books.find_in_batches { |s| T.assert_type!(s, T::Array[SpellBook]) }
|
186
|
+
T.assert_type!(spell_books.find_in_batches, T::Enumerator[T::Array[SpellBook]])
|
187
|
+
spell_books.in_batches { |s| T.assert_type!(s, SpellBook::ActiveRecord_AssociationRelation) }
|
188
|
+
T.assert_type!(spell_books.in_batches, T::Enumerable[SpellBook::ActiveRecord_AssociationRelation])
|
183
189
|
# T.assert_type!(spell_books.destroy_all, T::Array[SpellBook]) # Ignored until we add support
|
184
190
|
T.assert_type!(spell_books.any?, T::Boolean)
|
185
191
|
T.assert_type!(spell_books.many?, T::Boolean)
|
@@ -246,10 +252,12 @@ T.assert_type!(spell_books_query.create!(name: 'Fantastic Beasts') { |s| T.asser
|
|
246
252
|
T.assert_type!(spell_books_query.first_or_create(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
247
253
|
T.assert_type!(spell_books_query.first_or_create!(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
248
254
|
T.assert_type!(spell_books_query.first_or_initialize { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
255
|
+
spell_books_query.find_each { |s| T.assert_type!(s, SpellBook) }
|
256
|
+
T.assert_type!(spell_books_query.find_each, T::Enumerator[SpellBook])
|
257
|
+
spell_books_query.find_in_batches { |s| T.assert_type!(s, T::Array[SpellBook]) }
|
258
|
+
T.assert_type!(spell_books_query.find_in_batches, T::Enumerator[T::Array[SpellBook]])
|
259
|
+
spell_books_query.in_batches { |s| T.assert_type!(s, SpellBook::ActiveRecord_AssociationRelation) }
|
260
|
+
T.assert_type!(spell_books_query.in_batches, T::Enumerable[SpellBook::ActiveRecord_AssociationRelation])
|
253
261
|
# T.assert_type!(spell_books_query.destroy_all, T::Array[SpellBook]) # Ignored until we add support
|
254
262
|
T.assert_type!(spell_books_query.any?, T::Boolean)
|
255
263
|
T.assert_type!(spell_books_query.many?, T::Boolean)
|
@@ -75,7 +75,7 @@ class ActiveRecord::Base
|
|
75
75
|
def self.first_or_initialize(attributes = nil, &block); end
|
76
76
|
|
77
77
|
sig do
|
78
|
-
|
78
|
+
params(
|
79
79
|
start: T.nilable(Integer),
|
80
80
|
finish: T.nilable(Integer),
|
81
81
|
batch_size: T.nilable(Integer),
|
@@ -86,7 +86,7 @@ class ActiveRecord::Base
|
|
86
86
|
def self.find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, &block); end
|
87
87
|
|
88
88
|
sig do
|
89
|
-
|
89
|
+
params(
|
90
90
|
start: T.nilable(Integer),
|
91
91
|
finish: T.nilable(Integer),
|
92
92
|
batch_size: T.nilable(Integer),
|