sorbet-rails 0.6.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -0
  3. data/README.md +3 -3
  4. data/lib/bundled_rbi/typed_enum.rbi +7 -0
  5. data/lib/sorbet-rails.rb +0 -2
  6. data/lib/sorbet-rails/active_record_rbi_formatter.rb +301 -0
  7. data/lib/sorbet-rails/config.rb +0 -1
  8. data/lib/sorbet-rails/dependent_gem_rbis/activerecord.rbi +11 -0
  9. data/lib/sorbet-rails/deprecation.rb +5 -0
  10. data/lib/sorbet-rails/gem_plugins/active_flag_plugin.rb +0 -1
  11. data/lib/sorbet-rails/gem_plugins/paperclip_plugin.rb +0 -1
  12. data/lib/sorbet-rails/model_plugins/active_record_assoc.rb +36 -8
  13. data/lib/sorbet-rails/model_plugins/active_record_attribute.rb +20 -9
  14. data/lib/sorbet-rails/model_plugins/active_record_enum.rb +0 -1
  15. data/lib/sorbet-rails/model_plugins/active_record_named_scope.rb +15 -6
  16. data/lib/sorbet-rails/model_plugins/active_record_querying.rb +34 -3
  17. data/lib/sorbet-rails/model_plugins/active_storage_methods.rb +1 -1
  18. data/lib/sorbet-rails/model_plugins/base.rb +10 -0
  19. data/lib/sorbet-rails/model_plugins/enumerable_collections.rb +0 -50
  20. data/lib/sorbet-rails/model_plugins/plugins.rb +0 -3
  21. data/lib/sorbet-rails/model_rbi_formatter.rb +6 -10
  22. data/lib/sorbet-rails/model_utils.rb +83 -36
  23. data/lib/sorbet-rails/rails_mixins/generated_url_helpers.rb +2 -3
  24. data/lib/sorbet-rails/railtie.rb +0 -2
  25. data/lib/sorbet-rails/tasks/rails_rbi.rake +32 -24
  26. data/sorbet-rails.gemspec +2 -2
  27. data/spec/active_record_rbi_formatter_spec.rb +24 -0
  28. data/spec/generators/rails-template.rb +90 -6
  29. data/spec/generators/sorbet_test_cases.rb +204 -122
  30. data/spec/model_rbi_formatter_spec.rb +1 -1
  31. data/spec/rails_helper.rb +14 -1
  32. data/spec/rake_rails_rbi_active_record_spec.rb +21 -0
  33. data/spec/rake_rails_rbi_models_spec.rb +7 -0
  34. data/spec/sorbet_spec.rb +12 -1
  35. data/spec/support/v5.0/Gemfile.lock +8 -8
  36. data/spec/support/v5.0/app/models/headmaster.rb +8 -0
  37. data/spec/support/v5.0/app/models/school.rb +2 -0
  38. data/spec/support/v5.0/app/models/spell.rb +5 -0
  39. data/spec/support/v5.0/app/models/spell_book.rb +5 -0
  40. data/spec/support/v5.0/app/models/subject.rb +5 -0
  41. data/spec/support/v5.0/app/models/wizard.rb +6 -1
  42. data/spec/support/v5.0/db/migrate/20190620000010_add_subject.rb +8 -0
  43. data/spec/support/v5.0/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
  44. data/spec/support/v5.0/db/migrate/20190620000012_add_spell.rb +8 -0
  45. data/spec/support/v5.0/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
  46. data/spec/support/v5.0/db/migrate/20190620000014_create_headmasters.rb +9 -0
  47. data/spec/support/v5.0/db/schema.rb +28 -1
  48. data/spec/support/v5.0/lib/mythical_rbi_plugin.rb +1 -1
  49. data/spec/support/v5.0/sorbet_test_cases.rb +204 -122
  50. data/spec/support/v5.1/Gemfile.lock +8 -8
  51. data/spec/support/v5.1/app/models/headmaster.rb +8 -0
  52. data/spec/support/v5.1/app/models/school.rb +2 -0
  53. data/spec/support/v5.1/app/models/spell.rb +5 -0
  54. data/spec/support/v5.1/app/models/spell_book.rb +5 -0
  55. data/spec/support/v5.1/app/models/subject.rb +5 -0
  56. data/spec/support/v5.1/app/models/wizard.rb +6 -1
  57. data/spec/support/v5.1/db/migrate/20190620000010_add_subject.rb +8 -0
  58. data/spec/support/v5.1/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
  59. data/spec/support/v5.1/db/migrate/20190620000012_add_spell.rb +8 -0
  60. data/spec/support/v5.1/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
  61. data/spec/support/v5.1/db/migrate/20190620000014_create_headmasters.rb +9 -0
  62. data/spec/support/v5.1/db/schema.rb +28 -1
  63. data/spec/support/v5.1/lib/mythical_rbi_plugin.rb +1 -1
  64. data/spec/support/v5.1/sorbet_test_cases.rb +204 -122
  65. data/spec/support/v5.2/Gemfile +1 -1
  66. data/spec/support/v5.2/Gemfile.lock +9 -9
  67. data/spec/support/v5.2/app/models/headmaster.rb +8 -0
  68. data/spec/support/v5.2/app/models/school.rb +2 -0
  69. data/spec/support/v5.2/app/models/spell.rb +5 -0
  70. data/spec/support/v5.2/app/models/spell_book.rb +5 -0
  71. data/spec/support/v5.2/app/models/subject.rb +5 -0
  72. data/spec/support/v5.2/app/models/wizard.rb +5 -0
  73. data/spec/support/v5.2/config/puma.rb +3 -0
  74. data/spec/support/v5.2/db/migrate/20190620000010_add_subject.rb +8 -0
  75. data/spec/support/v5.2/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
  76. data/spec/support/v5.2/db/migrate/20190620000012_add_spell.rb +8 -0
  77. data/spec/support/v5.2/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
  78. data/spec/support/v5.2/db/migrate/20190620000014_create_headmasters.rb +9 -0
  79. data/spec/support/v5.2/db/schema.rb +28 -1
  80. data/spec/support/v5.2/lib/mythical_rbi_plugin.rb +1 -1
  81. data/spec/support/v5.2/sorbet_test_cases.rb +204 -122
  82. data/spec/support/v6.0/Gemfile.lock +8 -8
  83. data/spec/support/v6.0/app/models/headmaster.rb +8 -0
  84. data/spec/support/v6.0/app/models/school.rb +2 -0
  85. data/spec/support/v6.0/app/models/spell.rb +5 -0
  86. data/spec/support/v6.0/app/models/spell_book.rb +5 -0
  87. data/spec/support/v6.0/app/models/subject.rb +5 -0
  88. data/spec/support/v6.0/app/models/wizard.rb +6 -1
  89. data/spec/support/v6.0/db/migrate/20190620000010_add_subject.rb +8 -0
  90. data/spec/support/v6.0/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
  91. data/spec/support/v6.0/db/migrate/20190620000012_add_spell.rb +8 -0
  92. data/spec/support/v6.0/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
  93. data/spec/support/v6.0/db/migrate/20190620000014_create_headmasters.rb +9 -0
  94. data/spec/support/v6.0/db/schema.rb +28 -1
  95. data/spec/support/v6.0/lib/mythical_rbi_plugin.rb +1 -1
  96. data/spec/support/v6.0/sorbet_test_cases.rb +204 -122
  97. data/spec/test_data/v5.0/expected_active_record_base.rbi +113 -0
  98. data/spec/test_data/v5.0/expected_active_record_relation.rbi +199 -0
  99. data/spec/test_data/v5.0/expected_habtm_subjects.rbi +660 -0
  100. data/spec/test_data/v5.0/expected_habtm_wizards.rbi +660 -0
  101. data/spec/test_data/v5.0/expected_headmaster.rbi +304 -0
  102. data/spec/test_data/v5.0/expected_internal_metadata.rbi +38 -401
  103. data/spec/test_data/v5.0/expected_potion.rbi +38 -401
  104. data/spec/test_data/v5.0/expected_robe.rbi +38 -403
  105. data/spec/test_data/v5.0/expected_schema_migration.rbi +38 -401
  106. data/spec/test_data/v5.0/expected_school.rbi +47 -401
  107. data/spec/test_data/v5.0/expected_spell.rbi +292 -0
  108. data/spec/test_data/v5.0/expected_spell/habtm_spell_books.rbi +295 -0
  109. data/spec/test_data/v5.0/expected_spell_book.rbi +86 -432
  110. data/spec/test_data/v5.0/expected_spell_book/habtm_spell_books.rbi +637 -0
  111. data/spec/test_data/v5.0/expected_spell_book/habtm_spells.rbi +295 -0
  112. data/spec/test_data/v5.0/expected_squib.rbi +122 -477
  113. data/spec/test_data/v5.0/expected_subject.rbi +292 -0
  114. data/spec/test_data/v5.0/expected_subject/habtm_wizards.rbi +295 -0
  115. data/spec/test_data/v5.0/expected_wand.rbi +75 -442
  116. data/spec/test_data/v5.0/expected_wizard.rbi +144 -498
  117. data/spec/test_data/v5.0/expected_wizard/habtm_subjects.rbi +295 -0
  118. data/spec/test_data/v5.0/expected_wizard_wo_spellbook.rbi +138 -498
  119. data/spec/test_data/v5.1/expected_active_record_base.rbi +113 -0
  120. data/spec/test_data/v5.1/expected_active_record_relation.rbi +178 -0
  121. data/spec/test_data/v5.1/expected_habtm_subjects.rbi +672 -0
  122. data/spec/test_data/v5.1/expected_habtm_wizards.rbi +672 -0
  123. data/spec/test_data/v5.1/expected_headmaster.rbi +310 -0
  124. data/spec/test_data/v5.1/expected_internal_metadata.rbi +38 -407
  125. data/spec/test_data/v5.1/expected_potion.rbi +38 -407
  126. data/spec/test_data/v5.1/expected_robe.rbi +38 -409
  127. data/spec/test_data/v5.1/expected_schema_migration.rbi +38 -407
  128. data/spec/test_data/v5.1/expected_school.rbi +47 -407
  129. data/spec/test_data/v5.1/expected_spell.rbi +298 -0
  130. data/spec/test_data/v5.1/expected_spell/habtm_spell_books.rbi +301 -0
  131. data/spec/test_data/v5.1/expected_spell_book.rbi +86 -438
  132. data/spec/test_data/v5.1/expected_spell_book/habtm_spell_books.rbi +649 -0
  133. data/spec/test_data/v5.1/expected_spell_book/habtm_spells.rbi +301 -0
  134. data/spec/test_data/v5.1/expected_squib.rbi +123 -484
  135. data/spec/test_data/v5.1/expected_subject.rbi +298 -0
  136. data/spec/test_data/v5.1/expected_subject/habtm_wizards.rbi +301 -0
  137. data/spec/test_data/v5.1/expected_wand.rbi +75 -448
  138. data/spec/test_data/v5.1/expected_wizard.rbi +145 -505
  139. data/spec/test_data/v5.1/expected_wizard/habtm_subjects.rbi +301 -0
  140. data/spec/test_data/v5.1/expected_wizard_wo_spellbook.rbi +139 -505
  141. data/spec/test_data/v5.2/expected_active_record_base.rbi +113 -0
  142. data/spec/test_data/v5.2/expected_active_record_relation.rbi +175 -0
  143. data/spec/test_data/v5.2/expected_attachment.rbi +38 -407
  144. data/spec/test_data/v5.2/expected_blob.rbi +60 -426
  145. data/spec/test_data/v5.2/expected_habtm_subjects.rbi +672 -0
  146. data/spec/test_data/v5.2/expected_habtm_wizards.rbi +672 -0
  147. data/spec/test_data/v5.2/expected_headmaster.rbi +310 -0
  148. data/spec/test_data/v5.2/expected_internal_metadata.rbi +38 -407
  149. data/spec/test_data/v5.2/expected_potion.rbi +38 -407
  150. data/spec/test_data/v5.2/expected_robe.rbi +38 -409
  151. data/spec/test_data/v5.2/expected_schema_migration.rbi +38 -407
  152. data/spec/test_data/v5.2/expected_school.rbi +47 -407
  153. data/spec/test_data/v5.2/expected_spell.rbi +298 -0
  154. data/spec/test_data/v5.2/expected_spell/habtm_spell_books.rbi +301 -0
  155. data/spec/test_data/v5.2/expected_spell_book.rbi +86 -438
  156. data/spec/test_data/v5.2/expected_spell_book/habtm_spell_books.rbi +649 -0
  157. data/spec/test_data/v5.2/expected_spell_book/habtm_spells.rbi +301 -0
  158. data/spec/test_data/v5.2/expected_squib.rbi +133 -488
  159. data/spec/test_data/v5.2/expected_subject.rbi +298 -0
  160. data/spec/test_data/v5.2/expected_subject/habtm_wizards.rbi +301 -0
  161. data/spec/test_data/v5.2/expected_wand.rbi +75 -448
  162. data/spec/test_data/v5.2/expected_wizard.rbi +155 -509
  163. data/spec/test_data/v5.2/expected_wizard/habtm_subjects.rbi +301 -0
  164. data/spec/test_data/v5.2/expected_wizard_wo_spellbook.rbi +149 -509
  165. data/spec/test_data/v6.0/expected_active_record_base.rbi +113 -0
  166. data/spec/test_data/v6.0/expected_active_record_relation.rbi +175 -0
  167. data/spec/test_data/v6.0/expected_attachment.rbi +38 -431
  168. data/spec/test_data/v6.0/expected_blob.rbi +60 -450
  169. data/spec/test_data/v6.0/expected_habtm_subjects.rbi +720 -0
  170. data/spec/test_data/v6.0/expected_habtm_wizards.rbi +720 -0
  171. data/spec/test_data/v6.0/expected_headmaster.rbi +334 -0
  172. data/spec/test_data/v6.0/expected_internal_metadata.rbi +38 -431
  173. data/spec/test_data/v6.0/expected_potion.rbi +38 -431
  174. data/spec/test_data/v6.0/expected_robe.rbi +38 -433
  175. data/spec/test_data/v6.0/expected_routes.rbi +14 -7
  176. data/spec/test_data/v6.0/expected_schema_migration.rbi +38 -431
  177. data/spec/test_data/v6.0/expected_school.rbi +47 -431
  178. data/spec/test_data/v6.0/expected_spell.rbi +322 -0
  179. data/spec/test_data/v6.0/expected_spell/habtm_spell_books.rbi +325 -0
  180. data/spec/test_data/v6.0/expected_spell_book.rbi +98 -474
  181. data/spec/test_data/v6.0/expected_spell_book/habtm_spell_books.rbi +697 -0
  182. data/spec/test_data/v6.0/expected_spell_book/habtm_spells.rbi +325 -0
  183. data/spec/test_data/v6.0/expected_squib.rbi +162 -541
  184. data/spec/test_data/v6.0/expected_subject.rbi +322 -0
  185. data/spec/test_data/v6.0/expected_subject/habtm_wizards.rbi +325 -0
  186. data/spec/test_data/v6.0/expected_wand.rbi +91 -488
  187. data/spec/test_data/v6.0/expected_wizard.rbi +184 -562
  188. data/spec/test_data/v6.0/expected_wizard/habtm_subjects.rbi +325 -0
  189. data/spec/test_data/v6.0/expected_wizard_wo_spellbook.rbi +178 -562
  190. metadata +170 -24
  191. data/lib/bundled_rbi/active_record_base.rbi +0 -83
  192. data/lib/bundled_rbi/active_record_relation.rbi +0 -122
  193. data/lib/bundled_rbi/parameters.rbi +0 -28
  194. data/lib/sorbet-rails/custom_types/boolean_string.rb +0 -32
  195. data/lib/sorbet-rails/custom_types/integer_string.rb +0 -35
  196. data/lib/sorbet-rails/model_plugins/active_record_finder_methods.rb +0 -131
  197. data/lib/sorbet-rails/rails_mixins/custom_params_methods.rb +0 -46
  198. data/spec/boolean_string_spec.rb +0 -59
  199. data/spec/custom_params_methods_spec.rb +0 -138
  200. data/spec/integer_string_spec.rb +0 -46
  201. data/spec/support/v5.0/typed-override.yaml +0 -2
  202. data/spec/support/v5.1/typed-override.yaml +0 -2
  203. data/spec/support/v5.2/typed-override.yaml +0 -2
  204. data/spec/support/v6.0/typed-override.yaml +0 -2
@@ -3,8 +3,6 @@
3
3
 
4
4
  # typed: strong
5
5
  module SpellBook::EnumInstanceMethods
6
- extend T::Sig
7
-
8
6
  sig { returns(T::Boolean) }
9
7
  def unclassified?; end
10
8
 
@@ -30,8 +28,6 @@ module SpellBook::ActiveRelation_WhereNot
30
28
  end
31
29
 
32
30
  module SpellBook::GeneratedAttributeMethods
33
- extend T::Sig
34
-
35
31
  sig { returns(String) }
36
32
  def book_type; end
37
33
 
@@ -50,10 +46,10 @@ module SpellBook::GeneratedAttributeMethods
50
46
  sig { returns(T::Boolean) }
51
47
  def id?; end
52
48
 
53
- sig { returns(T.nilable(String)) }
49
+ sig { returns(String) }
54
50
  def name; end
55
51
 
56
- sig { params(value: T.nilable(T.any(String, Symbol))).void }
52
+ sig { params(value: T.any(String, Symbol)).void }
57
53
  def name=(value); end
58
54
 
59
55
  sig { returns(T::Boolean) }
@@ -71,15 +67,22 @@ end
71
67
 
72
68
  class SpellBook::BookType < T::Enum
73
69
  enums do
74
- Unclassified = new('unclassified')
75
- Biology = new('biology')
76
- DarkArt = new('dark_art')
70
+ Unclassified = new(%q{unclassified})
71
+ Biology = new(%q{biology})
72
+ DarkArt = new(%q{dark_art})
77
73
  end
78
74
 
79
75
  end
80
76
 
81
77
  module SpellBook::GeneratedAssociationMethods
82
- extend T::Sig
78
+ sig { returns(::Spell::ActiveRecord_Associations_CollectionProxy) }
79
+ def spells; end
80
+
81
+ sig { returns(T::Array[Integer]) }
82
+ def spell_ids; end
83
+
84
+ sig { params(value: T::Enumerable[::Spell]).void }
85
+ def spells=(value); end
83
86
 
84
87
  sig { returns(::Wizard) }
85
88
  def wizard; end
@@ -110,8 +113,7 @@ class SpellBook < ApplicationRecord
110
113
  include SpellBook::GeneratedAttributeMethods
111
114
  include SpellBook::GeneratedAssociationMethods
112
115
  extend SpellBook::CustomFinderMethods
113
- extend T::Sig
114
- extend T::Generic
116
+ extend SpellBook::QueryMethodsReturningRelation
115
117
  RelationType = T.type_alias { T.any(SpellBook::ActiveRecord_Relation, SpellBook::ActiveRecord_Associations_CollectionProxy, SpellBook::ActiveRecord_AssociationRelation) }
116
118
 
117
119
  sig { returns(T::Hash[T.any(String, Symbol), Integer]) }
@@ -133,158 +135,114 @@ class SpellBook < ApplicationRecord
133
135
  def self.not_unclassified(*args); end
134
136
 
135
137
  sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
136
- def self.unclassified(*args); end
137
-
138
- sig { returns(SpellBook::ActiveRecord_Relation) }
139
- def self.all; end
140
-
141
- sig { params(block: T.nilable(T.proc.void)).returns(SpellBook::ActiveRecord_Relation) }
142
- def self.unscoped(&block); end
143
-
144
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
145
- def self.select(*args); end
146
-
147
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
148
- def self.reselect(*args); end
149
-
150
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
151
- def self.order(*args); end
152
-
153
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
154
- def self.reorder(*args); end
155
-
156
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
157
- def self.group(*args); end
158
-
159
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
160
- def self.limit(*args); end
138
+ def self.recent(*args); end
161
139
 
162
140
  sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
163
- def self.offset(*args); end
164
-
165
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
166
- def self.joins(*args); end
167
-
168
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
169
- def self.left_joins(*args); end
170
-
171
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
172
- def self.left_outer_joins(*args); end
173
-
174
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
175
- def self.where(*args); end
176
-
177
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
178
- def self.rewhere(*args); end
179
-
180
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
181
- def self.preload(*args); end
182
-
183
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
184
- def self.extract_associated(*args); end
185
-
186
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
187
- def self.eager_load(*args); end
188
-
189
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
190
- def self.includes(*args); end
191
-
192
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
193
- def self.from(*args); end
194
-
195
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
196
- def self.lock(*args); end
197
-
198
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
199
- def self.readonly(*args); end
200
-
201
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
202
- def self.or(*args); end
141
+ def self.unclassified(*args); end
203
142
 
204
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
205
- def self.having(*args); end
143
+ sig { returns(SpellBook::BookType) }
144
+ def typed_book_type; end
206
145
 
207
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
208
- def self.create_with(*args); end
146
+ sig { params(value: SpellBook::BookType).void }
147
+ def typed_book_type=(value); end
148
+ end
209
149
 
210
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
211
- def self.distinct(*args); end
150
+ class SpellBook::ActiveRecord_Relation < ActiveRecord::Relation
151
+ include SpellBook::ActiveRelation_WhereNot
152
+ include SpellBook::CustomFinderMethods
153
+ include SpellBook::QueryMethodsReturningRelation
154
+ Elem = type_member(fixed: SpellBook)
212
155
 
213
156
  sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
214
- def self.references(*args); end
157
+ def biology(*args); end
215
158
 
216
159
  sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
217
- def self.none(*args); end
160
+ def dark_art(*args); end
218
161
 
219
162
  sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
220
- def self.unscope(*args); end
163
+ def not_biology(*args); end
221
164
 
222
165
  sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
223
- def self.optimizer_hints(*args); end
166
+ def not_dark_art(*args); end
224
167
 
225
168
  sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
226
- def self.merge(*args); end
169
+ def not_unclassified(*args); end
227
170
 
228
171
  sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
229
- def self.except(*args); end
172
+ def recent(*args); end
230
173
 
231
174
  sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
232
- def self.only(*args); end
233
-
234
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(SpellBook::ActiveRecord_Relation) }
235
- def self.extending(*args, &block); end
175
+ def unclassified(*args); end
176
+ end
236
177
 
237
- sig { returns(SpellBook::BookType) }
238
- def typed_book_type; end
178
+ class SpellBook::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
179
+ include SpellBook::ActiveRelation_WhereNot
180
+ include SpellBook::CustomFinderMethods
181
+ include SpellBook::QueryMethodsReturningAssociationRelation
182
+ Elem = type_member(fixed: SpellBook)
239
183
 
240
- sig { params(value: SpellBook::BookType).void }
241
- def typed_book_type=(value); end
184
+ sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
185
+ def biology(*args); end
242
186
 
243
- sig { params(conditions: T.untyped).returns(T::Boolean) }
244
- def self.exists?(conditions = nil); end
187
+ sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
188
+ def dark_art(*args); end
245
189
 
246
- sig { params(args: T.untyped).returns(T::Boolean) }
247
- def self.any?(*args); end
190
+ sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
191
+ def not_biology(*args); end
248
192
 
249
- sig { params(args: T.untyped).returns(T::Boolean) }
250
- def self.many?(*args); end
193
+ sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
194
+ def not_dark_art(*args); end
251
195
 
252
- sig { params(args: T.untyped).returns(T::Boolean) }
253
- def self.none?(*args); end
196
+ sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
197
+ def not_unclassified(*args); end
254
198
 
255
- sig { params(args: T.untyped).returns(T::Boolean) }
256
- def self.one?(*args); end
199
+ sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
200
+ def recent(*args); end
257
201
 
258
- sig { params(args: T.untyped).returns(T::Boolean) }
259
- def self.empty?(*args); end
202
+ sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
203
+ def unclassified(*args); end
260
204
  end
261
205
 
262
- class SpellBook::ActiveRecord_Relation < ActiveRecord::Relation
263
- include SpellBook::ActiveRelation_WhereNot
206
+ class SpellBook::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
264
207
  include SpellBook::CustomFinderMethods
265
- include Enumerable
266
- extend T::Sig
267
- extend T::Generic
208
+ include SpellBook::QueryMethodsReturningAssociationRelation
268
209
  Elem = type_member(fixed: SpellBook)
269
210
 
270
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
211
+ sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
271
212
  def biology(*args); end
272
213
 
273
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
214
+ sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
274
215
  def dark_art(*args); end
275
216
 
276
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
217
+ sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
277
218
  def not_biology(*args); end
278
219
 
279
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
220
+ sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
280
221
  def not_dark_art(*args); end
281
222
 
282
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
223
+ sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
283
224
  def not_unclassified(*args); end
284
225
 
285
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
226
+ sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
227
+ def recent(*args); end
228
+
229
+ sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
286
230
  def unclassified(*args); end
287
231
 
232
+ sig { params(records: T.any(SpellBook, T::Array[SpellBook])).returns(T.self_type) }
233
+ def <<(*records); end
234
+
235
+ sig { params(records: T.any(SpellBook, T::Array[SpellBook])).returns(T.self_type) }
236
+ def append(*records); end
237
+
238
+ sig { params(records: T.any(SpellBook, T::Array[SpellBook])).returns(T.self_type) }
239
+ def push(*records); end
240
+
241
+ sig { params(records: T.any(SpellBook, T::Array[SpellBook])).returns(T.self_type) }
242
+ def concat(*records); end
243
+ end
244
+
245
+ module SpellBook::QueryMethodsReturningRelation
288
246
  sig { returns(SpellBook::ActiveRecord_Relation) }
289
247
  def all; end
290
248
 
@@ -384,269 +342,24 @@ class SpellBook::ActiveRecord_Relation < ActiveRecord::Relation
384
342
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(SpellBook::ActiveRecord_Relation) }
385
343
  def extending(*args, &block); end
386
344
 
387
- sig { params(conditions: T.untyped).returns(T::Boolean) }
388
- def exists?(conditions = nil); end
389
-
390
- sig { params(args: T.untyped).returns(T::Boolean) }
391
- def any?(*args); end
392
-
393
- sig { params(args: T.untyped).returns(T::Boolean) }
394
- def many?(*args); end
395
-
396
- sig { params(args: T.untyped).returns(T::Boolean) }
397
- def none?(*args); end
398
-
399
- sig { params(args: T.untyped).returns(T::Boolean) }
400
- def one?(*args); end
401
-
402
- sig { params(args: T.untyped).returns(T::Boolean) }
403
- def empty?(*args); end
404
- end
405
-
406
- class SpellBook::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
407
- include SpellBook::ActiveRelation_WhereNot
408
- include SpellBook::CustomFinderMethods
409
- include Enumerable
410
- extend T::Sig
411
- extend T::Generic
412
- Elem = type_member(fixed: SpellBook)
413
-
414
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
415
- def biology(*args); end
416
-
417
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
418
- def dark_art(*args); end
419
-
420
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
421
- def not_biology(*args); end
422
-
423
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
424
- def not_dark_art(*args); end
425
-
426
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
427
- def not_unclassified(*args); end
428
-
429
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
430
- def unclassified(*args); end
431
-
432
- sig { returns(SpellBook::ActiveRecord_AssociationRelation) }
433
- def all; end
434
-
435
- sig { params(block: T.nilable(T.proc.void)).returns(SpellBook::ActiveRecord_AssociationRelation) }
436
- def unscoped(&block); end
437
-
438
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
439
- def select(*args); end
440
-
441
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
442
- def reselect(*args); end
443
-
444
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
445
- def order(*args); end
446
-
447
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
448
- def reorder(*args); end
449
-
450
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
451
- def group(*args); end
452
-
453
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
454
- def limit(*args); end
455
-
456
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
457
- def offset(*args); end
458
-
459
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
460
- def joins(*args); end
461
-
462
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
463
- def left_joins(*args); end
464
-
465
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
466
- def left_outer_joins(*args); end
467
-
468
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
469
- def where(*args); end
470
-
471
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
472
- def rewhere(*args); end
473
-
474
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
475
- def preload(*args); end
476
-
477
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
478
- def extract_associated(*args); end
479
-
480
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
481
- def eager_load(*args); end
482
-
483
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
484
- def includes(*args); end
485
-
486
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
487
- def from(*args); end
488
-
489
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
490
- def lock(*args); end
491
-
492
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
493
- def readonly(*args); end
494
-
495
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
496
- def or(*args); end
497
-
498
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
499
- def having(*args); end
500
-
501
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
502
- def create_with(*args); end
503
-
504
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
505
- def distinct(*args); end
506
-
507
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
508
- def references(*args); end
509
-
510
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
511
- def none(*args); end
512
-
513
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
514
- def unscope(*args); end
515
-
516
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
517
- def optimizer_hints(*args); end
518
-
519
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
520
- def merge(*args); end
521
-
522
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
523
- def except(*args); end
524
-
525
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
526
- def only(*args); end
527
-
528
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(SpellBook::ActiveRecord_AssociationRelation) }
529
- def extending(*args, &block); end
530
-
531
- sig { params(args: T.untyped).returns(SpellBook) }
532
- def find(*args); end
533
-
534
- sig { params(args: T.untyped).returns(T.nilable(SpellBook)) }
535
- def find_by(*args); end
536
-
537
- sig { params(args: T.untyped).returns(SpellBook) }
538
- def find_by!(*args); end
539
-
540
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: SpellBook).void)).returns(SpellBook) }
541
- def find_or_initialize_by(attributes, &block); end
542
-
543
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: SpellBook).void)).returns(SpellBook) }
544
- def find_or_create_by(attributes, &block); end
545
-
546
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: SpellBook).void)).returns(SpellBook) }
547
- def find_or_create_by!(attributes, &block); end
548
-
549
- sig { returns(T.nilable(SpellBook)) }
550
- def first; end
551
-
552
- sig { returns(SpellBook) }
553
- def first!; end
554
-
555
- sig { returns(T.nilable(SpellBook)) }
556
- def second; end
557
-
558
- sig { returns(SpellBook) }
559
- def second!; end
560
-
561
- sig { returns(T.nilable(SpellBook)) }
562
- def third; end
563
-
564
- sig { returns(SpellBook) }
565
- def third!; end
566
-
567
- sig { returns(T.nilable(SpellBook)) }
568
- def third_to_last; end
569
-
570
- sig { returns(SpellBook) }
571
- def third_to_last!; end
572
-
573
- sig { returns(T.nilable(SpellBook)) }
574
- def second_to_last; end
575
-
576
- sig { returns(SpellBook) }
577
- def second_to_last!; end
578
-
579
- sig { returns(T.nilable(SpellBook)) }
580
- def last; end
581
-
582
- sig { returns(SpellBook) }
583
- def last!; end
584
-
585
- sig { params(conditions: T.untyped).returns(T::Boolean) }
586
- def exists?(conditions = nil); end
587
-
588
- sig { params(args: T.untyped).returns(T::Boolean) }
589
- def any?(*args); end
590
-
591
- sig { params(args: T.untyped).returns(T::Boolean) }
592
- def many?(*args); end
593
-
594
- sig { params(args: T.untyped).returns(T::Boolean) }
595
- def none?(*args); end
596
-
597
- sig { params(args: T.untyped).returns(T::Boolean) }
598
- def one?(*args); end
599
-
600
- sig { params(args: T.untyped).returns(T::Boolean) }
601
- def empty?(*args); end
602
-
603
- sig { override.params(block: T.proc.params(e: SpellBook).void).returns(T::Array[SpellBook]) }
604
- def each(&block); end
605
-
606
- sig { params(level: T.nilable(Integer)).returns(T::Array[SpellBook]) }
607
- def flatten(level); end
608
-
609
- sig { returns(T::Array[SpellBook]) }
610
- def to_a; end
611
-
612
345
  sig do
613
- type_parameters(:U).params(
614
- blk: T.proc.params(arg0: Elem).returns(T.type_parameter(:U)),
615
- )
616
- .returns(T::Array[T.type_parameter(:U)])
346
+ params(
347
+ of: T.nilable(Integer),
348
+ start: T.nilable(Integer),
349
+ finish: T.nilable(Integer),
350
+ load: T.nilable(T::Boolean),
351
+ error_on_ignore: T.nilable(T::Boolean),
352
+ block: T.nilable(T.proc.params(e: SpellBook::ActiveRecord_Relation).void)
353
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
617
354
  end
618
- def map(&blk); end
355
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
619
356
  end
620
357
 
621
- class SpellBook::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
622
- include SpellBook::CustomFinderMethods
623
- include Enumerable
624
- extend T::Sig
625
- extend T::Generic
626
- Elem = type_member(fixed: SpellBook)
627
-
628
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
629
- def biology(*args); end
630
-
631
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
632
- def dark_art(*args); end
633
-
634
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
635
- def not_biology(*args); end
636
-
637
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
638
- def not_dark_art(*args); end
639
-
640
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
641
- def not_unclassified(*args); end
642
-
643
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
644
- def unclassified(*args); end
645
-
358
+ module SpellBook::QueryMethodsReturningAssociationRelation
646
359
  sig { returns(SpellBook::ActiveRecord_AssociationRelation) }
647
360
  def all; end
648
361
 
649
- sig { params(block: T.nilable(T.proc.void)).returns(SpellBook::ActiveRecord_AssociationRelation) }
362
+ sig { params(block: T.nilable(T.proc.void)).returns(SpellBook::ActiveRecord_Relation) }
650
363
  def unscoped(&block); end
651
364
 
652
365
  sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_AssociationRelation) }
@@ -742,104 +455,15 @@ class SpellBook::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Assoc
742
455
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(SpellBook::ActiveRecord_AssociationRelation) }
743
456
  def extending(*args, &block); end
744
457
 
745
- sig { params(args: T.untyped).returns(SpellBook) }
746
- def find(*args); end
747
-
748
- sig { params(args: T.untyped).returns(T.nilable(SpellBook)) }
749
- def find_by(*args); end
750
-
751
- sig { params(args: T.untyped).returns(SpellBook) }
752
- def find_by!(*args); end
753
-
754
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: SpellBook).void)).returns(SpellBook) }
755
- def find_or_initialize_by(attributes, &block); end
756
-
757
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: SpellBook).void)).returns(SpellBook) }
758
- def find_or_create_by(attributes, &block); end
759
-
760
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: SpellBook).void)).returns(SpellBook) }
761
- def find_or_create_by!(attributes, &block); end
762
-
763
- sig { returns(T.nilable(SpellBook)) }
764
- def first; end
765
-
766
- sig { returns(SpellBook) }
767
- def first!; end
768
-
769
- sig { returns(T.nilable(SpellBook)) }
770
- def second; end
771
-
772
- sig { returns(SpellBook) }
773
- def second!; end
774
-
775
- sig { returns(T.nilable(SpellBook)) }
776
- def third; end
777
-
778
- sig { returns(SpellBook) }
779
- def third!; end
780
-
781
- sig { returns(T.nilable(SpellBook)) }
782
- def third_to_last; end
783
-
784
- sig { returns(SpellBook) }
785
- def third_to_last!; end
786
-
787
- sig { returns(T.nilable(SpellBook)) }
788
- def second_to_last; end
789
-
790
- sig { returns(SpellBook) }
791
- def second_to_last!; end
792
-
793
- sig { returns(T.nilable(SpellBook)) }
794
- def last; end
795
-
796
- sig { returns(SpellBook) }
797
- def last!; end
798
-
799
- sig { params(conditions: T.untyped).returns(T::Boolean) }
800
- def exists?(conditions = nil); end
801
-
802
- sig { params(args: T.untyped).returns(T::Boolean) }
803
- def any?(*args); end
804
-
805
- sig { params(args: T.untyped).returns(T::Boolean) }
806
- def many?(*args); end
807
-
808
- sig { params(args: T.untyped).returns(T::Boolean) }
809
- def none?(*args); end
810
-
811
- sig { params(args: T.untyped).returns(T::Boolean) }
812
- def one?(*args); end
813
-
814
- sig { params(args: T.untyped).returns(T::Boolean) }
815
- def empty?(*args); end
816
-
817
- sig { override.params(block: T.proc.params(e: SpellBook).void).returns(T::Array[SpellBook]) }
818
- def each(&block); end
819
-
820
- sig { params(level: T.nilable(Integer)).returns(T::Array[SpellBook]) }
821
- def flatten(level); end
822
-
823
- sig { returns(T::Array[SpellBook]) }
824
- def to_a; end
825
-
826
458
  sig do
827
- type_parameters(:U).params(
828
- blk: T.proc.params(arg0: Elem).returns(T.type_parameter(:U)),
829
- )
830
- .returns(T::Array[T.type_parameter(:U)])
459
+ params(
460
+ of: T.nilable(Integer),
461
+ start: T.nilable(Integer),
462
+ finish: T.nilable(Integer),
463
+ load: T.nilable(T::Boolean),
464
+ error_on_ignore: T.nilable(T::Boolean),
465
+ block: T.nilable(T.proc.params(e: SpellBook::ActiveRecord_AssociationRelation).void)
466
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
831
467
  end
832
- def map(&blk); end
833
-
834
- sig { params(records: T.any(SpellBook, T::Array[SpellBook])).returns(T.self_type) }
835
- def <<(*records); end
836
-
837
- sig { params(records: T.any(SpellBook, T::Array[SpellBook])).returns(T.self_type) }
838
- def append(*records); end
839
-
840
- sig { params(records: T.any(SpellBook, T::Array[SpellBook])).returns(T.self_type) }
841
- def push(*records); end
842
-
843
- sig { params(records: T.any(SpellBook, T::Array[SpellBook])).returns(T.self_type) }
844
- def concat(*records); end
468
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
845
469
  end