sorbet-rails 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sorbet-rails/active_record_rbi_formatter.rb +295 -0
- data/lib/sorbet-rails/config.rb +0 -1
- data/lib/sorbet-rails/custom_types/boolean_string.rb +10 -0
- data/lib/sorbet-rails/custom_types/integer_string.rb +10 -0
- data/lib/sorbet-rails/dependent_gem_rbis/activerecord.rbi +11 -0
- data/lib/sorbet-rails/deprecation.rb +5 -0
- data/lib/sorbet-rails/model_plugins/active_record_assoc.rb +27 -6
- data/lib/sorbet-rails/model_plugins/active_record_attribute.rb +20 -8
- data/lib/sorbet-rails/model_plugins/base.rb +9 -0
- data/lib/sorbet-rails/model_plugins/enumerable_collections.rb +0 -50
- data/lib/sorbet-rails/model_plugins/plugins.rb +0 -3
- data/lib/sorbet-rails/model_rbi_formatter.rb +2 -2
- data/lib/sorbet-rails/model_utils.rb +15 -6
- data/lib/sorbet-rails/rails_mixins/custom_params_methods.rb +11 -0
- data/lib/sorbet-rails/tasks/rails_rbi.rake +20 -4
- data/sorbet-rails.gemspec +2 -2
- data/spec/active_record_rbi_formatter_spec.rb +24 -0
- data/spec/generators/rails-template.rb +88 -1
- data/spec/generators/sorbet_test_cases.rb +146 -42
- data/spec/model_rbi_formatter_spec.rb +1 -1
- data/spec/rails_helper.rb +14 -1
- data/spec/rake_rails_rbi_active_record_spec.rb +21 -0
- data/spec/rake_rails_rbi_models_spec.rb +7 -0
- data/spec/sorbet_spec.rb +12 -1
- data/spec/support/v5.0/Gemfile.lock +8 -8
- data/spec/support/v5.0/app/models/headmaster.rb +8 -0
- data/spec/support/v5.0/app/models/school.rb +2 -0
- data/spec/support/v5.0/app/models/spell.rb +5 -0
- data/spec/support/v5.0/app/models/spell_book.rb +3 -0
- data/spec/support/v5.0/app/models/subject.rb +5 -0
- data/spec/support/v5.0/app/models/wizard.rb +6 -1
- data/spec/support/v5.0/db/migrate/20190620000010_add_subject.rb +8 -0
- data/spec/support/v5.0/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
- data/spec/support/v5.0/db/migrate/20190620000012_add_spell.rb +8 -0
- data/spec/support/v5.0/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
- data/spec/support/v5.0/db/migrate/20190620000014_create_headmasters.rb +9 -0
- data/spec/support/v5.0/db/schema.rb +28 -1
- data/spec/support/v5.0/lib/mythical_rbi_plugin.rb +1 -1
- data/spec/support/v5.0/sorbet_test_cases.rb +146 -42
- data/spec/support/v5.1/Gemfile.lock +8 -8
- data/spec/support/v5.1/app/models/headmaster.rb +8 -0
- data/spec/support/v5.1/app/models/school.rb +2 -0
- data/spec/support/v5.1/app/models/spell.rb +5 -0
- data/spec/support/v5.1/app/models/spell_book.rb +3 -0
- data/spec/support/v5.1/app/models/subject.rb +5 -0
- data/spec/support/v5.1/app/models/wizard.rb +6 -1
- data/spec/support/v5.1/db/migrate/20190620000010_add_subject.rb +8 -0
- data/spec/support/v5.1/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
- data/spec/support/v5.1/db/migrate/20190620000012_add_spell.rb +8 -0
- data/spec/support/v5.1/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
- data/spec/support/v5.1/db/migrate/20190620000014_create_headmasters.rb +9 -0
- data/spec/support/v5.1/db/schema.rb +28 -1
- data/spec/support/v5.1/lib/mythical_rbi_plugin.rb +1 -1
- data/spec/support/v5.1/sorbet_test_cases.rb +146 -42
- data/spec/support/v5.2/Gemfile +1 -1
- data/spec/support/v5.2/Gemfile.lock +9 -9
- data/spec/support/v5.2/app/models/headmaster.rb +8 -0
- data/spec/support/v5.2/app/models/school.rb +2 -0
- data/spec/support/v5.2/app/models/spell.rb +5 -0
- data/spec/support/v5.2/app/models/spell_book.rb +3 -0
- data/spec/support/v5.2/app/models/subject.rb +5 -0
- data/spec/support/v5.2/app/models/wizard.rb +5 -0
- data/spec/support/v5.2/config/puma.rb +3 -0
- data/spec/support/v5.2/db/migrate/20190620000010_add_subject.rb +8 -0
- data/spec/support/v5.2/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
- data/spec/support/v5.2/db/migrate/20190620000012_add_spell.rb +8 -0
- data/spec/support/v5.2/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
- data/spec/support/v5.2/db/migrate/20190620000014_create_headmasters.rb +9 -0
- data/spec/support/v5.2/db/schema.rb +28 -1
- data/spec/support/v5.2/lib/mythical_rbi_plugin.rb +1 -1
- data/spec/support/v5.2/sorbet_test_cases.rb +146 -42
- data/spec/support/v6.0/Gemfile.lock +8 -8
- data/spec/support/v6.0/app/models/headmaster.rb +8 -0
- data/spec/support/v6.0/app/models/school.rb +2 -0
- data/spec/support/v6.0/app/models/spell.rb +5 -0
- data/spec/support/v6.0/app/models/spell_book.rb +3 -0
- data/spec/support/v6.0/app/models/subject.rb +5 -0
- data/spec/support/v6.0/app/models/wizard.rb +6 -1
- data/spec/support/v6.0/db/migrate/20190620000010_add_subject.rb +8 -0
- data/spec/support/v6.0/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
- data/spec/support/v6.0/db/migrate/20190620000012_add_spell.rb +8 -0
- data/spec/support/v6.0/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
- data/spec/support/v6.0/db/migrate/20190620000014_create_headmasters.rb +9 -0
- data/spec/support/v6.0/db/schema.rb +28 -1
- data/spec/support/v6.0/lib/mythical_rbi_plugin.rb +1 -1
- data/spec/support/v6.0/sorbet_test_cases.rb +146 -42
- data/spec/test_data/v5.0/expected_active_record_base.rbi +113 -0
- data/spec/test_data/v5.0/expected_active_record_relation.rbi +199 -0
- data/spec/test_data/v5.0/expected_habtm_subjects.rbi +660 -0
- data/spec/test_data/v5.0/expected_habtm_wizards.rbi +660 -0
- data/spec/test_data/v5.0/expected_headmaster.rbi +452 -0
- data/spec/test_data/v5.0/expected_internal_metadata.rbi +0 -217
- data/spec/test_data/v5.0/expected_potion.rbi +0 -217
- data/spec/test_data/v5.0/expected_robe.rbi +0 -217
- data/spec/test_data/v5.0/expected_schema_migration.rbi +0 -217
- data/spec/test_data/v5.0/expected_school.rbi +11 -217
- data/spec/test_data/v5.0/expected_spell.rbi +440 -0
- data/spec/test_data/v5.0/expected_spell/habtm_spell_books.rbi +443 -0
- data/spec/test_data/v5.0/expected_spell_book.rbi +14 -222
- data/spec/test_data/v5.0/expected_spell_book/habtm_spell_books.rbi +637 -0
- data/spec/test_data/v5.0/expected_spell_book/habtm_spells.rbi +443 -0
- data/spec/test_data/v5.0/expected_squib.rbi +14 -219
- data/spec/test_data/v5.0/expected_subject.rbi +440 -0
- data/spec/test_data/v5.0/expected_subject/habtm_wizards.rbi +443 -0
- data/spec/test_data/v5.0/expected_wand.rbi +4 -221
- data/spec/test_data/v5.0/expected_wizard.rbi +36 -240
- data/spec/test_data/v5.0/expected_wizard/habtm_subjects.rbi +443 -0
- data/spec/test_data/v5.0/expected_wizard_wo_spellbook.rbi +30 -240
- data/spec/test_data/v5.1/expected_active_record_base.rbi +113 -0
- data/spec/test_data/v5.1/expected_active_record_relation.rbi +178 -0
- data/spec/test_data/v5.1/expected_habtm_subjects.rbi +672 -0
- data/spec/test_data/v5.1/expected_habtm_wizards.rbi +672 -0
- data/spec/test_data/v5.1/expected_headmaster.rbi +464 -0
- data/spec/test_data/v5.1/expected_internal_metadata.rbi +0 -217
- data/spec/test_data/v5.1/expected_potion.rbi +0 -217
- data/spec/test_data/v5.1/expected_robe.rbi +0 -217
- data/spec/test_data/v5.1/expected_schema_migration.rbi +0 -217
- data/spec/test_data/v5.1/expected_school.rbi +11 -217
- data/spec/test_data/v5.1/expected_spell.rbi +452 -0
- data/spec/test_data/v5.1/expected_spell/habtm_spell_books.rbi +455 -0
- data/spec/test_data/v5.1/expected_spell_book.rbi +14 -222
- data/spec/test_data/v5.1/expected_spell_book/habtm_spell_books.rbi +649 -0
- data/spec/test_data/v5.1/expected_spell_book/habtm_spells.rbi +455 -0
- data/spec/test_data/v5.1/expected_squib.rbi +14 -219
- data/spec/test_data/v5.1/expected_subject.rbi +452 -0
- data/spec/test_data/v5.1/expected_subject/habtm_wizards.rbi +455 -0
- data/spec/test_data/v5.1/expected_wand.rbi +4 -221
- data/spec/test_data/v5.1/expected_wizard.rbi +36 -240
- data/spec/test_data/v5.1/expected_wizard/habtm_subjects.rbi +455 -0
- data/spec/test_data/v5.1/expected_wizard_wo_spellbook.rbi +30 -240
- data/spec/test_data/v5.2/expected_active_record_base.rbi +113 -0
- data/spec/test_data/v5.2/expected_active_record_relation.rbi +175 -0
- data/spec/test_data/v5.2/expected_attachment.rbi +0 -217
- data/spec/test_data/v5.2/expected_blob.rbi +3 -217
- data/spec/test_data/v5.2/expected_habtm_subjects.rbi +672 -0
- data/spec/test_data/v5.2/expected_habtm_wizards.rbi +672 -0
- data/spec/test_data/v5.2/expected_headmaster.rbi +464 -0
- data/spec/test_data/v5.2/expected_internal_metadata.rbi +0 -217
- data/spec/test_data/v5.2/expected_potion.rbi +0 -217
- data/spec/test_data/v5.2/expected_robe.rbi +0 -217
- data/spec/test_data/v5.2/expected_schema_migration.rbi +0 -217
- data/spec/test_data/v5.2/expected_school.rbi +11 -217
- data/spec/test_data/v5.2/expected_spell.rbi +452 -0
- data/spec/test_data/v5.2/expected_spell/habtm_spell_books.rbi +455 -0
- data/spec/test_data/v5.2/expected_spell_book.rbi +14 -222
- data/spec/test_data/v5.2/expected_spell_book/habtm_spell_books.rbi +649 -0
- data/spec/test_data/v5.2/expected_spell_book/habtm_spells.rbi +455 -0
- data/spec/test_data/v5.2/expected_squib.rbi +20 -219
- data/spec/test_data/v5.2/expected_subject.rbi +452 -0
- data/spec/test_data/v5.2/expected_subject/habtm_wizards.rbi +455 -0
- data/spec/test_data/v5.2/expected_wand.rbi +4 -221
- data/spec/test_data/v5.2/expected_wizard.rbi +42 -240
- data/spec/test_data/v5.2/expected_wizard/habtm_subjects.rbi +455 -0
- data/spec/test_data/v5.2/expected_wizard_wo_spellbook.rbi +36 -240
- data/spec/test_data/v6.0/expected_active_record_base.rbi +113 -0
- data/spec/test_data/v6.0/expected_active_record_relation.rbi +175 -0
- data/spec/test_data/v6.0/expected_attachment.rbi +0 -217
- data/spec/test_data/v6.0/expected_blob.rbi +3 -217
- data/spec/test_data/v6.0/expected_habtm_subjects.rbi +720 -0
- data/spec/test_data/v6.0/expected_habtm_wizards.rbi +720 -0
- data/spec/test_data/v6.0/expected_headmaster.rbi +512 -0
- data/spec/test_data/v6.0/expected_internal_metadata.rbi +0 -217
- data/spec/test_data/v6.0/expected_potion.rbi +0 -217
- data/spec/test_data/v6.0/expected_robe.rbi +0 -217
- data/spec/test_data/v6.0/expected_schema_migration.rbi +0 -217
- data/spec/test_data/v6.0/expected_school.rbi +11 -217
- data/spec/test_data/v6.0/expected_spell.rbi +500 -0
- data/spec/test_data/v6.0/expected_spell/habtm_spell_books.rbi +503 -0
- data/spec/test_data/v6.0/expected_spell_book.rbi +14 -222
- data/spec/test_data/v6.0/expected_spell_book/habtm_spell_books.rbi +697 -0
- data/spec/test_data/v6.0/expected_spell_book/habtm_spells.rbi +503 -0
- data/spec/test_data/v6.0/expected_squib.rbi +20 -219
- data/spec/test_data/v6.0/expected_subject.rbi +500 -0
- data/spec/test_data/v6.0/expected_subject/habtm_wizards.rbi +503 -0
- data/spec/test_data/v6.0/expected_wand.rbi +4 -221
- data/spec/test_data/v6.0/expected_wizard.rbi +42 -240
- data/spec/test_data/v6.0/expected_wizard/habtm_subjects.rbi +503 -0
- data/spec/test_data/v6.0/expected_wizard_wo_spellbook.rbi +36 -240
- metadata +169 -14
- data/lib/bundled_rbi/active_record_base.rbi +0 -83
- data/lib/bundled_rbi/active_record_relation.rbi +0 -122
- data/lib/sorbet-rails/model_plugins/active_record_finder_methods.rb +0 -131
- data/spec/support/v5.0/typed-override.yaml +0 -2
- data/spec/support/v5.1/typed-override.yaml +0 -2
- data/spec/support/v5.2/typed-override.yaml +0 -2
- data/spec/support/v6.0/typed-override.yaml +0 -2
@@ -5,6 +5,9 @@ class SpellBook < ApplicationRecord
|
|
5
5
|
# simulate when belongs_to is optional by default, but it is enforced at the DB level
|
6
6
|
belongs_to :wizard, optional: true
|
7
7
|
|
8
|
+
# habtm enforced at the DB level
|
9
|
+
has_and_belongs_to_many :spells
|
10
|
+
|
8
11
|
enum book_type: {
|
9
12
|
unclassified: 0,
|
10
13
|
biology: 1,
|
@@ -1,6 +1,8 @@
|
|
1
|
-
# typed:
|
1
|
+
# typed: strict
|
2
2
|
class Wizard < ApplicationRecord
|
3
3
|
validates :name, length: { minimum: 5 }, presence: true
|
4
|
+
# simulate conditional validation
|
5
|
+
validates :parent_email, presence: true, if: -> { false }
|
4
6
|
|
5
7
|
typed_enum house: {
|
6
8
|
Gryffindor: 0,
|
@@ -18,6 +20,7 @@ class Wizard < ApplicationRecord
|
|
18
20
|
"Pomona Sprout": 2,
|
19
21
|
"Filius Flitwick": 3,
|
20
22
|
"Hagrid": 4,
|
23
|
+
"Alastor 'Mad-Eye' Moody": 5,
|
21
24
|
}
|
22
25
|
|
23
26
|
typed_enum broom: {
|
@@ -46,6 +49,8 @@ class Wizard < ApplicationRecord
|
|
46
49
|
|
47
50
|
has_one :wand
|
48
51
|
has_many :spell_books
|
52
|
+
# habtm which is optional at the db level
|
53
|
+
has_and_belongs_to_many :subjects
|
49
54
|
|
50
55
|
# simulate when belongs_to is optional by default
|
51
56
|
belongs_to :school, optional: true
|
@@ -11,7 +11,14 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 2019_06_20_000014) do
|
15
|
+
|
16
|
+
create_table "headmasters", force: :cascade do |t|
|
17
|
+
t.integer "school_id"
|
18
|
+
t.integer "wizard_id"
|
19
|
+
t.index ["school_id"], name: "index_headmasters_on_school_id"
|
20
|
+
t.index ["wizard_id"], name: "index_headmasters_on_wizard_id"
|
21
|
+
end
|
15
22
|
|
16
23
|
create_table "robes", force: :cascade do |t|
|
17
24
|
t.integer "wizard_id"
|
@@ -29,6 +36,26 @@ ActiveRecord::Schema.define(version: 2019_06_20_000009) do
|
|
29
36
|
t.index ["wizard_id"], name: "index_spell_books_on_wizard_id"
|
30
37
|
end
|
31
38
|
|
39
|
+
create_table "spell_books_spells", id: false, force: :cascade do |t|
|
40
|
+
t.integer "spell_id", null: false
|
41
|
+
t.integer "spell_book_id", null: false
|
42
|
+
t.index ["spell_id", "spell_book_id"], name: "index_spell_books_spells_on_spell_id_and_spell_book_id"
|
43
|
+
end
|
44
|
+
|
45
|
+
create_table "spells", force: :cascade do |t|
|
46
|
+
t.string "name"
|
47
|
+
end
|
48
|
+
|
49
|
+
create_table "subjects", force: :cascade do |t|
|
50
|
+
t.string "name"
|
51
|
+
end
|
52
|
+
|
53
|
+
create_table "subjects_wizards", id: false, force: :cascade do |t|
|
54
|
+
t.integer "subject_id"
|
55
|
+
t.integer "wizard_id"
|
56
|
+
t.index ["subject_id", "wizard_id"], name: "index_subjects_wizards_on_subject_id_and_wizard_id"
|
57
|
+
end
|
58
|
+
|
32
59
|
create_table "wands", force: :cascade do |t|
|
33
60
|
t.integer "wizard_id", null: false
|
34
61
|
t.string "wood_type"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# typed:
|
1
|
+
# typed: true
|
2
2
|
require 'sorbet-runtime'
|
3
3
|
|
4
4
|
wand = Wand.first!
|
@@ -27,6 +27,7 @@ T.assert_type!(T.must(wizard.wand).wizard, Wizard)
|
|
27
27
|
# T.assert_type!(wizard.spell_books, SpellBook::ActiveRecord_Relation)
|
28
28
|
# T.assert_type!(wizard.spell_books, SpellBook::ActiveRecord_AssociationRelation)
|
29
29
|
T.assert_type!(wizard.spell_books, SpellBook::ActiveRecord_Associations_CollectionProxy)
|
30
|
+
T.assert_type!(wizard.spell_book_ids, T::Array[Integer])
|
30
31
|
|
31
32
|
# -- model relation
|
32
33
|
# default
|
@@ -53,6 +54,14 @@ T.assert_type!(Wizard.exists?(name: 'Test'), T::Boolean)
|
|
53
54
|
T.assert_type!(Wizard.find(wizard.id), Wizard)
|
54
55
|
T.assert_type!(Wizard.first!, Wizard)
|
55
56
|
T.assert_type!(Wizard.first, T.nilable(Wizard))
|
57
|
+
T.assert_type!(Wizard.second!, Wizard)
|
58
|
+
T.assert_type!(Wizard.second, T.nilable(Wizard))
|
59
|
+
T.assert_type!(Wizard.third!, Wizard)
|
60
|
+
T.assert_type!(Wizard.third, T.nilable(Wizard))
|
61
|
+
T.assert_type!(Wizard.third_to_last!, Wizard)
|
62
|
+
T.assert_type!(Wizard.third_to_last, T.nilable(Wizard))
|
63
|
+
T.assert_type!(Wizard.second_to_last!, Wizard)
|
64
|
+
T.assert_type!(Wizard.second_to_last, T.nilable(Wizard))
|
56
65
|
T.assert_type!(Wizard.last!, Wizard)
|
57
66
|
T.assert_type!(Wizard.last, T.nilable(Wizard))
|
58
67
|
T.assert_type!(Wizard.first_n(5), T::Array[Wizard])
|
@@ -61,12 +70,40 @@ T.assert_type!(Wizard.find_by(name: 'Harry Potter'), T.nilable(Wizard))
|
|
61
70
|
T.assert_type!(Wizard.find_by!(name: 'Harry Potter'), Wizard)
|
62
71
|
T.assert_type!(Wizard.find_by_id(wizard.id), T.nilable(Wizard))
|
63
72
|
T.assert_type!(Wizard.find_by_id!(wizard.id), Wizard)
|
73
|
+
T.assert_type!(Wizard.find_or_initialize_by(name: 'Harry Potter') { |w| T.assert_type!(w, Wizard) }, Wizard)
|
74
|
+
T.assert_type!(Wizard.find_or_create_by(name: 'Harry Potter') { |w| T.assert_type!(w, Wizard) }, Wizard)
|
75
|
+
T.assert_type!(Wizard.find_or_create_by!(name: 'Harry Potter') { |w| T.assert_type!(w, Wizard) }, Wizard)
|
76
|
+
T.assert_type!(Wizard.new { |w| T.assert_type!(w, Wizard) }, Wizard)
|
77
|
+
T.assert_type!(Wizard.create(name: 'Harry Potter') { |w| T.assert_type!(w, Wizard) }, Wizard)
|
78
|
+
T.assert_type!(Wizard.create!(name: 'Harry Potter') { |w| T.assert_type!(w, Wizard) }, Wizard)
|
79
|
+
T.assert_type!(Wizard.first_or_create(name: 'Harry Potter') { |w| T.assert_type!(w, Wizard) }, Wizard)
|
80
|
+
T.assert_type!(Wizard.first_or_create!(name: 'Harry Potter') { |w| T.assert_type!(w, Wizard) }, Wizard)
|
81
|
+
T.assert_type!(Wizard.first_or_initialize { |w| T.assert_type!(w, Wizard) }, Wizard)
|
82
|
+
Wizard.find_each { |w| T.assert_type!(w, Wizard) }
|
83
|
+
T.assert_type!(Wizard.find_each, T::Enumerator[Wizard])
|
84
|
+
Wizard.find_in_batches { |w| T.assert_type!(w, T::Array[Wizard]) }
|
85
|
+
T.assert_type!(Wizard.find_in_batches, T::Enumerator[T::Array[Wizard]])
|
86
|
+
# T.assert_type!(Wizard.destroy_all, T::Array[Wizard]) # Ignored until we add support
|
87
|
+
T.assert_type!(Wizard.any?, T::Boolean)
|
88
|
+
T.assert_type!(Wizard.many?, T::Boolean)
|
89
|
+
T.assert_type!(Wizard.none?, T::Boolean)
|
90
|
+
T.assert_type!(Wizard.one?, T::Boolean)
|
91
|
+
# T.assert_type!(Wizard.update_all(name: 'Harry Potter'), Integer) # Ignored until we add support
|
92
|
+
# T.assert_type!(Wizard.delete_all, Integer) # Ignored until we add support
|
64
93
|
|
65
94
|
# Finder methods -- ActiveRecord::Relation
|
66
95
|
T.assert_type!(Wizard.all.exists?(name: 'Harry Potter'), T::Boolean)
|
67
96
|
T.assert_type!(Wizard.all.find(wizard.id), Wizard)
|
68
97
|
T.assert_type!(Wizard.all.first!, Wizard)
|
69
98
|
T.assert_type!(Wizard.all.first, T.nilable(Wizard))
|
99
|
+
T.assert_type!(Wizard.all.second!, Wizard)
|
100
|
+
T.assert_type!(Wizard.all.second, T.nilable(Wizard))
|
101
|
+
T.assert_type!(Wizard.all.third!, Wizard)
|
102
|
+
T.assert_type!(Wizard.all.third, T.nilable(Wizard))
|
103
|
+
T.assert_type!(Wizard.all.third_to_last!, Wizard)
|
104
|
+
T.assert_type!(Wizard.all.third_to_last, T.nilable(Wizard))
|
105
|
+
T.assert_type!(Wizard.all.second_to_last!, Wizard)
|
106
|
+
T.assert_type!(Wizard.all.second_to_last, T.nilable(Wizard))
|
70
107
|
T.assert_type!(Wizard.all.last!, Wizard)
|
71
108
|
T.assert_type!(Wizard.all.last, T.nilable(Wizard))
|
72
109
|
T.assert_type!(Wizard.all.first_n(5), T::Array[Wizard])
|
@@ -75,6 +112,32 @@ T.assert_type!(Wizard.all.find_by(name: 'Harry Potter'), T.nilable(Wizard))
|
|
75
112
|
T.assert_type!(Wizard.all.find_by!(name: 'Harry Potter'), Wizard)
|
76
113
|
T.assert_type!(Wizard.all.find_by_id(wizard.id), T.nilable(Wizard))
|
77
114
|
T.assert_type!(Wizard.all.find_by_id!(wizard.id), Wizard)
|
115
|
+
T.assert_type!(Wizard.all.find_or_initialize_by(name: 'Harry Potter') { |w| T.assert_type!(w, Wizard) }, Wizard)
|
116
|
+
T.assert_type!(Wizard.all.find_or_create_by(name: 'Harry Potter') { |w| T.assert_type!(w, Wizard) }, Wizard)
|
117
|
+
T.assert_type!(Wizard.all.find_or_create_by!(name: 'Harry Potter') { |w| T.assert_type!(w, Wizard) }, Wizard)
|
118
|
+
T.assert_type!(Wizard.all.new { |w| T.assert_type!(w, Wizard) }, Wizard)
|
119
|
+
T.assert_type!(Wizard.all.build { |w| T.assert_type!(w, Wizard) }, Wizard)
|
120
|
+
T.assert_type!(Wizard.all.create(name: 'Harry Potter') { |w| T.assert_type!(w, Wizard) }, Wizard)
|
121
|
+
T.assert_type!(Wizard.all.create!(name: 'Harry Potter') { |w| T.assert_type!(w, Wizard) }, Wizard)
|
122
|
+
T.assert_type!(Wizard.all.first_or_create(name: 'Harry Potter') { |w| T.assert_type!(w, Wizard) }, Wizard)
|
123
|
+
T.assert_type!(Wizard.all.first_or_create!(name: 'Harry Potter') { |w| T.assert_type!(w, Wizard) }, Wizard)
|
124
|
+
T.assert_type!(Wizard.all.first_or_initialize { |w| T.assert_type!(w, Wizard) }, Wizard)
|
125
|
+
Wizard.all.find_each { |w| T.assert_type!(w, Wizard) }
|
126
|
+
T.assert_type!(Wizard.all.find_each, T::Enumerator[Wizard])
|
127
|
+
Wizard.all.find_in_batches { |w| T.assert_type!(w, T::Array[Wizard]) }
|
128
|
+
T.assert_type!(Wizard.all.find_in_batches, T::Enumerator[T::Array[Wizard]])
|
129
|
+
# T.assert_type!(Wizard.all.destroy_all, T::Array[Wizard]) # Ignored until we add support
|
130
|
+
T.assert_type!(Wizard.all.any?, T::Boolean)
|
131
|
+
T.assert_type!(Wizard.all.many?, T::Boolean)
|
132
|
+
T.assert_type!(Wizard.all.none?, T::Boolean)
|
133
|
+
T.assert_type!(Wizard.all.one?, T::Boolean)
|
134
|
+
# T.assert_type!(Wizard.all.update_all(name: 'Harry Potter'), Integer) # Ignored until we add support
|
135
|
+
# T.assert_type!(Wizard.all.delete_all, Integer) # Ignored until we add support
|
136
|
+
# Enumerable methods
|
137
|
+
Wizard.all.each { |w| T.assert_type!(w, Wizard) }
|
138
|
+
Wizard.all.map { |w| T.assert_type!(w, Wizard) }
|
139
|
+
T.assert_type!(Wizard.all.to_a, T::Array[Wizard])
|
140
|
+
T.assert_type!(Wizard.all.empty?, T::Boolean)
|
78
141
|
|
79
142
|
# Finder methods -- CollectionProxy
|
80
143
|
spell_book = wizard.spell_books.first!
|
@@ -82,15 +145,44 @@ spell_books = wizard.spell_books
|
|
82
145
|
T.assert_type!(spell_books.exists?(name: 'Fantastic Beasts'), T::Boolean)
|
83
146
|
T.assert_type!(spell_books.find(spell_book.id), SpellBook)
|
84
147
|
T.assert_type!(spell_books.first!, SpellBook)
|
85
|
-
|
148
|
+
T.assert_type!(spell_books.first, T.nilable(SpellBook))
|
149
|
+
T.assert_type!(spell_books.second!, SpellBook)
|
150
|
+
T.assert_type!(spell_books.second, T.nilable(SpellBook))
|
151
|
+
T.assert_type!(spell_books.third!, SpellBook)
|
152
|
+
T.assert_type!(spell_books.third, T.nilable(SpellBook))
|
153
|
+
T.assert_type!(spell_books.third_to_last!, SpellBook)
|
154
|
+
T.assert_type!(spell_books.third_to_last, T.nilable(SpellBook))
|
155
|
+
T.assert_type!(spell_books.second_to_last!, SpellBook)
|
156
|
+
T.assert_type!(spell_books.second_to_last, T.nilable(SpellBook))
|
86
157
|
T.assert_type!(spell_books.last!, SpellBook)
|
87
|
-
|
158
|
+
T.assert_type!(spell_books.last, T.nilable(SpellBook))
|
88
159
|
T.assert_type!(spell_books.first_n(5), T::Array[SpellBook])
|
89
160
|
T.assert_type!(spell_books.last_n(5), T::Array[SpellBook])
|
90
161
|
T.assert_type!(spell_books.find_by(name: 'Fantastic Beasts'), T.nilable(SpellBook))
|
91
162
|
T.assert_type!(spell_books.find_by!(name: 'Fantastic Beasts'), SpellBook)
|
92
163
|
T.assert_type!(spell_books.find_by_id(spell_book.id), T.nilable(SpellBook))
|
93
164
|
T.assert_type!(spell_books.find_by_id!(spell_book.id), SpellBook)
|
165
|
+
T.assert_type!(spell_books.find_or_initialize_by(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
166
|
+
T.assert_type!(spell_books.find_or_create_by(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
167
|
+
T.assert_type!(spell_books.find_or_create_by!(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
168
|
+
T.assert_type!(spell_books.new { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
169
|
+
T.assert_type!(spell_books.build { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
170
|
+
T.assert_type!(spell_books.create(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
171
|
+
T.assert_type!(spell_books.create!(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
172
|
+
T.assert_type!(spell_books.first_or_create(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
173
|
+
T.assert_type!(spell_books.first_or_create!(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
174
|
+
T.assert_type!(spell_books.first_or_initialize { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
175
|
+
# spell_books.find_each { |s| T.assert_type!(s, SpellBook) } # TODO: Handle for Rails 6
|
176
|
+
# T.assert_type!(spell_books.find_each, T::Enumerator[SpellBook]) # TODO: Handle for Rails 6
|
177
|
+
# spell_books.find_in_batches { |s| T.assert_type!(s, T::Array[SpellBook]) } # TODO: Handle for Rails 6
|
178
|
+
# T.assert_type!(spell_books.find_in_batches, T::Enumerator[T::Array[SpellBook]]) # TODO: Handle for Rails 6
|
179
|
+
# T.assert_type!(spell_books.destroy_all, T::Array[SpellBook]) # Ignored until we add support
|
180
|
+
T.assert_type!(spell_books.any?, T::Boolean)
|
181
|
+
T.assert_type!(spell_books.many?, T::Boolean)
|
182
|
+
T.assert_type!(spell_books.none?, T::Boolean)
|
183
|
+
T.assert_type!(spell_books.one?, T::Boolean)
|
184
|
+
# T.assert_type!(spell_books.update_all(name: 'Fantastic Beasts'), Integer) # Ignored until we add support
|
185
|
+
# T.assert_type!(spell_books.delete_all, Integer) # Ignored until we add support
|
94
186
|
# CollectionProxy query also typed correctly!
|
95
187
|
T.assert_type!(spell_books.where(id: 1), SpellBook::ActiveRecord_AssociationRelation)
|
96
188
|
T.assert_type!(spell_books.preload(:wizard), SpellBook::ActiveRecord_AssociationRelation)
|
@@ -98,63 +190,75 @@ T.assert_type!(spell_books.eager_load(:wizard), SpellBook::ActiveRecord_Associat
|
|
98
190
|
T.assert_type!(spell_books.order(:id), SpellBook::ActiveRecord_AssociationRelation)
|
99
191
|
T.assert_type!(spell_books.where.not(id: 1), SpellBook::ActiveRecord_AssociationRelation)
|
100
192
|
T.assert_type!(spell_books.biology, SpellBook::ActiveRecord_AssociationRelation)
|
193
|
+
# Enumerable methods
|
194
|
+
spell_books.each { |s| T.assert_type!(s, SpellBook) }
|
195
|
+
spell_books.map { |s| T.assert_type!(s, SpellBook) }
|
196
|
+
T.assert_type!(spell_books.to_a, T::Array[SpellBook])
|
197
|
+
T.assert_type!(spell_books.empty?, T::Boolean)
|
198
|
+
# Push methods
|
199
|
+
T.assert_type!(spell_books << spell_book, SpellBook::ActiveRecord_Associations_CollectionProxy)
|
200
|
+
T.assert_type!(spell_books << [spell_book], SpellBook::ActiveRecord_Associations_CollectionProxy)
|
201
|
+
T.assert_type!(spell_books.append(spell_book), SpellBook::ActiveRecord_Associations_CollectionProxy)
|
202
|
+
T.assert_type!(spell_books.append([spell_book]), SpellBook::ActiveRecord_Associations_CollectionProxy)
|
203
|
+
T.assert_type!(spell_books.push(spell_book), SpellBook::ActiveRecord_Associations_CollectionProxy)
|
204
|
+
T.assert_type!(spell_books.push([spell_book]), SpellBook::ActiveRecord_Associations_CollectionProxy)
|
205
|
+
# T.assert_type!(spell_books.concat(spell_book), SpellBook::ActiveRecord_Associations_CollectionProxy) # TODO: In Rails 5.0 and 5.1 this actually returns T::Array
|
206
|
+
# T.assert_type!(spell_books.concat([spell_book]), SpellBook::ActiveRecord_Associations_CollectionProxy) # TODO: In Rails 5.0 and 5.1 this actually returns T::Array
|
101
207
|
|
102
208
|
# finder methods -- AssociationRelation
|
103
|
-
spell_books_query = spell_books.where(
|
209
|
+
spell_books_query = spell_books.where(wizard_id: wizard.id)
|
104
210
|
T.assert_type!(spell_books_query.exists?(name: 'Fantastic Beasts'), T::Boolean)
|
105
211
|
T.assert_type!(spell_books_query.find(spell_book.id), SpellBook)
|
106
212
|
T.assert_type!(spell_books_query.first!, SpellBook)
|
107
|
-
|
213
|
+
T.assert_type!(spell_books_query.first, T.nilable(SpellBook))
|
214
|
+
T.assert_type!(spell_books_query.second!, SpellBook)
|
215
|
+
T.assert_type!(spell_books_query.second, T.nilable(SpellBook))
|
216
|
+
T.assert_type!(spell_books_query.third!, SpellBook)
|
217
|
+
T.assert_type!(spell_books_query.third, T.nilable(SpellBook))
|
218
|
+
T.assert_type!(spell_books_query.third_to_last!, SpellBook)
|
219
|
+
T.assert_type!(spell_books_query.third_to_last, T.nilable(SpellBook))
|
220
|
+
T.assert_type!(spell_books_query.second_to_last!, SpellBook)
|
221
|
+
T.assert_type!(spell_books_query.second_to_last, T.nilable(SpellBook))
|
108
222
|
T.assert_type!(spell_books_query.last!, SpellBook)
|
109
|
-
|
223
|
+
T.assert_type!(spell_books_query.last, T.nilable(SpellBook))
|
110
224
|
T.assert_type!(spell_books_query.first_n(5), T::Array[SpellBook])
|
111
225
|
T.assert_type!(spell_books_query.last_n(5), T::Array[SpellBook])
|
112
226
|
T.assert_type!(spell_books_query.find_by(name: 'Fantastic Beasts'), T.nilable(SpellBook))
|
113
227
|
T.assert_type!(spell_books_query.find_by!(name: 'Fantastic Beasts'), SpellBook)
|
114
228
|
T.assert_type!(spell_books_query.find_by_id(spell_book.id), T.nilable(SpellBook))
|
115
229
|
T.assert_type!(spell_books_query.find_by_id!(spell_book.id), SpellBook)
|
230
|
+
T.assert_type!(spell_books_query.find_or_initialize_by(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
231
|
+
T.assert_type!(spell_books_query.find_or_create_by(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
232
|
+
T.assert_type!(spell_books_query.find_or_create_by!(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook)
|
233
|
+
T.assert_type!(spell_books_query.new { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
234
|
+
T.assert_type!(spell_books_query.build { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support # Ignored until we add support
|
235
|
+
T.assert_type!(spell_books_query.create(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
236
|
+
T.assert_type!(spell_books_query.create!(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
237
|
+
T.assert_type!(spell_books_query.first_or_create(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
238
|
+
T.assert_type!(spell_books_query.first_or_create!(name: 'Fantastic Beasts') { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
239
|
+
T.assert_type!(spell_books_query.first_or_initialize { |s| T.assert_type!(s, SpellBook) }, SpellBook) # Ignored until we add support
|
240
|
+
# spell_books_query.find_each { |s| T.assert_type!(s, SpellBook) } # TODO: Handle for Rails 6
|
241
|
+
# T.assert_type!(spell_books_query.find_each, T::Enumerator[SpellBook]) # TODO: Handle for Rails 6
|
242
|
+
# spell_books_query.find_in_batches { |s| T.assert_type!(s, T::Array[SpellBook]) } # TODO: Handle for Rails 6
|
243
|
+
# T.assert_type!(spell_books_query.find_in_batches, T::Enumerator[T::Array[SpellBook]]) # TODO: Handle for Rails 6
|
244
|
+
# T.assert_type!(spell_books_query.destroy_all, T::Array[SpellBook]) # Ignored until we add support
|
245
|
+
T.assert_type!(spell_books_query.any?, T::Boolean)
|
246
|
+
T.assert_type!(spell_books_query.many?, T::Boolean)
|
247
|
+
T.assert_type!(spell_books_query.none?, T::Boolean)
|
248
|
+
T.assert_type!(spell_books_query.one?, T::Boolean)
|
249
|
+
# T.assert_type!(spell_books_query.update_all(name: 'Fantastic Beasts'), Integer) # Ignored until we add support
|
250
|
+
# T.assert_type!(spell_books_query.delete_all, Integer) # Ignored until we add support
|
116
251
|
# Query chaining
|
117
252
|
T.assert_type!(spell_books_query.preload(:wizard), SpellBook::ActiveRecord_AssociationRelation)
|
118
253
|
T.assert_type!(spell_books_query.eager_load(:wizard), SpellBook::ActiveRecord_AssociationRelation)
|
119
254
|
T.assert_type!(spell_books_query.order(:id), SpellBook::ActiveRecord_AssociationRelation)
|
120
255
|
T.assert_type!(spell_books_query.where.not(id: 1), SpellBook::ActiveRecord_AssociationRelation)
|
121
256
|
T.assert_type!(spell_books_query.biology, SpellBook::ActiveRecord_AssociationRelation)
|
122
|
-
|
123
|
-
|
124
|
-
T.assert_type!(
|
125
|
-
|
126
|
-
|
127
|
-
end
|
128
|
-
Wizard.all.map do |w|
|
129
|
-
T.assert_type!(w, Wizard)
|
130
|
-
end
|
131
|
-
Wizard.all.to_a.map do |w|
|
132
|
-
T.assert_type!(w, Wizard)
|
133
|
-
end
|
134
|
-
|
135
|
-
# enum on association collection proxy
|
136
|
-
T.assert_type!(wizard.spell_books.to_a, T::Array[SpellBook])
|
137
|
-
wizard.spell_books.each do |sp|
|
138
|
-
T.assert_type!(sp, SpellBook)
|
139
|
-
end
|
140
|
-
wizard.spell_books.map do |sp|
|
141
|
-
T.assert_type!(sp, SpellBook)
|
142
|
-
end
|
143
|
-
wizard.spell_books.to_a.map do |sp|
|
144
|
-
T.assert_type!(sp, SpellBook)
|
145
|
-
end
|
146
|
-
|
147
|
-
# enum on association relation
|
148
|
-
T.assert_type!(wizard.spell_books.where(id: 1).to_a, T::Array[SpellBook])
|
149
|
-
wizard.spell_books.where(id: 1).each do |sp|
|
150
|
-
T.assert_type!(sp, SpellBook)
|
151
|
-
end
|
152
|
-
wizard.spell_books.where(id: 1).map do |sp|
|
153
|
-
T.assert_type!(sp, SpellBook)
|
154
|
-
end
|
155
|
-
wizard.spell_books.where(id: 1).to_a.map do |sp|
|
156
|
-
T.assert_type!(sp, SpellBook)
|
157
|
-
end
|
257
|
+
# Enumerable methods
|
258
|
+
spell_books_query.each { |s| T.assert_type!(s, SpellBook) }
|
259
|
+
spell_books_query.map { |s| T.assert_type!(s, SpellBook) }
|
260
|
+
T.assert_type!(spell_books_query.to_a, T::Array[SpellBook])
|
261
|
+
T.assert_type!(spell_books_query.empty?, T::Boolean)
|
158
262
|
|
159
263
|
# Model columns
|
160
264
|
T.assert_type!(wizard.id, Integer)
|
@@ -0,0 +1,113 @@
|
|
1
|
+
# typed: strong
|
2
|
+
# This is an autogenerated file for Rails' ActiveRecord.
|
3
|
+
# Please rerun bundle exec rake rails_rbi:active_record to regenerate.
|
4
|
+
class ActiveRecord::Base
|
5
|
+
sig { params(args: T.untyped).returns(T.attached_class) }
|
6
|
+
def self.find(*args); end
|
7
|
+
|
8
|
+
sig { params(args: T.untyped).returns(T.nilable(T.attached_class)) }
|
9
|
+
def self.find_by(*args); end
|
10
|
+
|
11
|
+
sig { params(args: T.untyped).returns(T.attached_class) }
|
12
|
+
def self.find_by!(*args); end
|
13
|
+
|
14
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: T.attached_class).void)).returns(T.attached_class) }
|
15
|
+
def self.find_or_initialize_by(attributes, &block); end
|
16
|
+
|
17
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: T.attached_class).void)).returns(T.attached_class) }
|
18
|
+
def self.find_or_create_by(attributes, &block); end
|
19
|
+
|
20
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: T.attached_class).void)).returns(T.attached_class) }
|
21
|
+
def self.find_or_create_by!(attributes, &block); end
|
22
|
+
|
23
|
+
sig { returns(T.nilable(T.attached_class)) }
|
24
|
+
def self.first; end
|
25
|
+
|
26
|
+
sig { returns(T.attached_class) }
|
27
|
+
def self.first!; end
|
28
|
+
|
29
|
+
sig { returns(T.nilable(T.attached_class)) }
|
30
|
+
def self.second; end
|
31
|
+
|
32
|
+
sig { returns(T.attached_class) }
|
33
|
+
def self.second!; end
|
34
|
+
|
35
|
+
sig { returns(T.nilable(T.attached_class)) }
|
36
|
+
def self.third; end
|
37
|
+
|
38
|
+
sig { returns(T.attached_class) }
|
39
|
+
def self.third!; end
|
40
|
+
|
41
|
+
sig { returns(T.nilable(T.attached_class)) }
|
42
|
+
def self.third_to_last; end
|
43
|
+
|
44
|
+
sig { returns(T.attached_class) }
|
45
|
+
def self.third_to_last!; end
|
46
|
+
|
47
|
+
sig { returns(T.nilable(T.attached_class)) }
|
48
|
+
def self.second_to_last; end
|
49
|
+
|
50
|
+
sig { returns(T.attached_class) }
|
51
|
+
def self.second_to_last!; end
|
52
|
+
|
53
|
+
sig { returns(T.nilable(T.attached_class)) }
|
54
|
+
def self.last; end
|
55
|
+
|
56
|
+
sig { returns(T.attached_class) }
|
57
|
+
def self.last!; end
|
58
|
+
|
59
|
+
sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: T.attached_class).void)).returns(T.attached_class) }
|
60
|
+
def self.create(*args, &block); end
|
61
|
+
|
62
|
+
sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: T.attached_class).void)).returns(T.attached_class) }
|
63
|
+
def self.create!(*args, &block); end
|
64
|
+
|
65
|
+
sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: T.attached_class).void)).returns(T.attached_class) }
|
66
|
+
def self.new(*args, &block); end
|
67
|
+
|
68
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: T.attached_class).void)).returns(T.attached_class) }
|
69
|
+
def self.first_or_create(attributes = nil, &block); end
|
70
|
+
|
71
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: T.attached_class).void)).returns(T.attached_class) }
|
72
|
+
def self.first_or_create!(attributes = nil, &block); end
|
73
|
+
|
74
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: T.attached_class).void)).returns(T.attached_class) }
|
75
|
+
def self.first_or_initialize(attributes = nil, &block); end
|
76
|
+
|
77
|
+
sig do
|
78
|
+
override.params(
|
79
|
+
start: T.nilable(Integer),
|
80
|
+
finish: T.nilable(Integer),
|
81
|
+
batch_size: T.nilable(Integer),
|
82
|
+
error_on_ignore: T.nilable(T::Boolean),
|
83
|
+
block: T.nilable(T.proc.params(e: T.attached_class).void)
|
84
|
+
).returns(T::Enumerator[T.attached_class])
|
85
|
+
end
|
86
|
+
def self.find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, &block); end
|
87
|
+
|
88
|
+
sig do
|
89
|
+
override.params(
|
90
|
+
start: T.nilable(Integer),
|
91
|
+
finish: T.nilable(Integer),
|
92
|
+
batch_size: T.nilable(Integer),
|
93
|
+
error_on_ignore: T.nilable(T::Boolean),
|
94
|
+
block: T.nilable(T.proc.params(e: T::Array[T.attached_class]).void)
|
95
|
+
).returns(T::Enumerator[T::Array[T.attached_class]])
|
96
|
+
end
|
97
|
+
def self.find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, &block); end
|
98
|
+
|
99
|
+
sig { params(conditions: T.untyped).returns(T::Boolean) }
|
100
|
+
def self.exists?(conditions = nil); end
|
101
|
+
|
102
|
+
sig { returns(T::Boolean) }
|
103
|
+
def self.any?; end
|
104
|
+
|
105
|
+
sig { returns(T::Boolean) }
|
106
|
+
def self.many?; end
|
107
|
+
|
108
|
+
sig { returns(T::Boolean) }
|
109
|
+
def self.none?; end
|
110
|
+
|
111
|
+
sig { returns(T::Boolean) }
|
112
|
+
def self.one?; end
|
113
|
+
end
|