sorbet-rails 0.6.3 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +1 -2
  3. data/.gitignore +2 -1
  4. data/.travis.yml +3 -1
  5. data/README.md +54 -7
  6. data/Rakefile +3 -3
  7. data/lib/bundled_rbi/customizabel_rbi_formatter.rbi +29 -0
  8. data/lib/bundled_rbi/pluck_to_tstruct.rbi +2 -1
  9. data/lib/bundled_rbi/typed_enum.rbi +7 -0
  10. data/lib/sorbet-rails.rb +1 -3
  11. data/lib/sorbet-rails/active_record_rbi_formatter.rb +8 -2
  12. data/lib/sorbet-rails/config.rb +11 -0
  13. data/lib/sorbet-rails/deprecation.rb +1 -0
  14. data/lib/sorbet-rails/gem_plugins/active_flag_plugin.rb +0 -1
  15. data/lib/sorbet-rails/gem_plugins/kaminari_plugin.rb +8 -0
  16. data/lib/sorbet-rails/gem_plugins/paperclip_plugin.rb +0 -1
  17. data/lib/sorbet-rails/job_rbi_formatter.rb +73 -62
  18. data/lib/sorbet-rails/mailer_rbi_formatter.rb +40 -27
  19. data/lib/sorbet-rails/model_column_utils.rb +129 -0
  20. data/lib/sorbet-rails/model_plugins/active_record_assoc.rb +37 -3
  21. data/lib/sorbet-rails/model_plugins/active_record_attribute.rb +0 -103
  22. data/lib/sorbet-rails/model_plugins/active_record_enum.rb +0 -1
  23. data/lib/sorbet-rails/model_plugins/active_record_named_scope.rb +15 -6
  24. data/lib/sorbet-rails/model_plugins/active_record_querying.rb +34 -3
  25. data/lib/sorbet-rails/model_plugins/active_storage_methods.rb +1 -1
  26. data/lib/sorbet-rails/model_plugins/base.rb +0 -9
  27. data/lib/sorbet-rails/model_rbi_formatter.rb +4 -8
  28. data/lib/sorbet-rails/model_utils.rb +73 -32
  29. data/lib/sorbet-rails/rails_mixins/generated_url_helpers.rb +2 -3
  30. data/lib/sorbet-rails/rails_mixins/pluck_to_tstruct.rb +17 -7
  31. data/lib/sorbet-rails/railtie.rb +0 -2
  32. data/lib/sorbet-rails/sorbet_utils.rb +152 -150
  33. data/lib/sorbet-rails/tasks/rails_rbi.rake +18 -26
  34. data/sorbet-rails.gemspec +1 -1
  35. data/spec/generators/rails-template.rb +3 -6
  36. data/spec/generators/sorbet_test_cases.rb +66 -88
  37. data/spec/job_rbi_formatter_spec.rb +1 -1
  38. data/spec/pluck_to_tstruct_spec.rb +74 -1
  39. data/spec/rails_helper.rb +2 -2
  40. data/spec/rake_rails_rbi_jobs_spec.rb +20 -0
  41. data/spec/rake_rails_rbi_mailers_spec.rb +21 -0
  42. data/spec/support/v5.0/Gemfile +1 -1
  43. data/spec/support/v5.0/Gemfile.lock +9 -9
  44. data/spec/support/v5.0/app/models/spell_book.rb +2 -0
  45. data/spec/support/v5.0/app/models/wizard.rb +1 -1
  46. data/spec/support/v5.0/sorbet_test_cases.rb +66 -88
  47. data/spec/support/v5.1/Gemfile.lock +7 -7
  48. data/spec/support/v5.1/app/models/spell_book.rb +2 -0
  49. data/spec/support/v5.1/app/models/wizard.rb +1 -1
  50. data/spec/support/v5.1/sorbet_test_cases.rb +66 -88
  51. data/spec/support/v5.2/Gemfile +1 -1
  52. data/spec/support/v5.2/Gemfile.lock +9 -9
  53. data/spec/support/v5.2/app/models/spell_book.rb +2 -0
  54. data/spec/support/v5.2/app/models/wizard.rb +1 -1
  55. data/spec/support/v5.2/sorbet_test_cases.rb +66 -88
  56. data/spec/support/v6.0/.gitignore +6 -0
  57. data/spec/support/v6.0/Gemfile +3 -3
  58. data/spec/support/v6.0/Gemfile.lock +77 -76
  59. data/spec/support/v6.0/app/models/spell_book.rb +2 -0
  60. data/spec/support/v6.0/app/models/wizard.rb +1 -1
  61. data/spec/support/v6.0/bin/bundle +22 -13
  62. data/spec/support/v6.0/config/environments/test.rb +1 -1
  63. data/spec/support/v6.0/sorbet_test_cases.rb +66 -88
  64. data/spec/support/v6.0/tmp/pids/.keep +0 -0
  65. data/spec/test_data/v5.0/expected_active_record_base.rbi +2 -2
  66. data/spec/test_data/v5.0/expected_active_record_relation.rbi +2 -2
  67. data/spec/test_data/v5.0/expected_custom_application_job.rbi +21 -0
  68. data/spec/test_data/v5.0/expected_custom_application_mailer.rbi +6 -0
  69. data/spec/test_data/v5.0/expected_custom_award_house_point_hourglasses.rbi +21 -0
  70. data/spec/test_data/v5.0/expected_custom_daily_prophet_mailer.rbi +8 -0
  71. data/spec/test_data/v5.0/expected_custom_hogwarts_acceptance_mailer.rbi +21 -0
  72. data/spec/test_data/v5.0/expected_headmaster.rbi +60 -190
  73. data/spec/test_data/v5.0/expected_internal_metadata.rbi +42 -188
  74. data/spec/test_data/v5.0/expected_potion.rbi +51 -188
  75. data/spec/test_data/v5.0/expected_robe.rbi +51 -190
  76. data/spec/test_data/v5.0/expected_schema_migration.rbi +42 -188
  77. data/spec/test_data/v5.0/expected_school.rbi +51 -190
  78. data/spec/test_data/v5.0/expected_spell.rbi +42 -190
  79. data/spec/test_data/v5.0/expected_spell/habtm_spell_books.rbi +60 -190
  80. data/spec/test_data/v5.0/expected_spell_book.rbi +86 -215
  81. data/spec/test_data/v5.0/expected_spell_book/habtm_spells.rbi +60 -190
  82. data/spec/test_data/v5.0/expected_squib.rbi +131 -263
  83. data/spec/test_data/v5.0/expected_subject.rbi +42 -190
  84. data/spec/test_data/v5.0/expected_subject/habtm_wizards.rbi +60 -190
  85. data/spec/test_data/v5.0/expected_wand.rbi +84 -225
  86. data/spec/test_data/v5.0/expected_wizard.rbi +131 -263
  87. data/spec/test_data/v5.0/expected_wizard/habtm_subjects.rbi +60 -190
  88. data/spec/test_data/v5.0/expected_wizard_wo_spellbook.rbi +131 -263
  89. data/spec/test_data/v5.1/expected_active_record_base.rbi +2 -2
  90. data/spec/test_data/v5.1/expected_active_record_relation.rbi +2 -2
  91. data/spec/test_data/v5.1/expected_custom_application_job.rbi +21 -0
  92. data/spec/test_data/v5.1/expected_custom_application_mailer.rbi +6 -0
  93. data/spec/test_data/v5.1/expected_custom_award_house_point_hourglasses.rbi +21 -0
  94. data/spec/test_data/v5.1/expected_custom_daily_prophet_mailer.rbi +8 -0
  95. data/spec/test_data/v5.1/expected_custom_hogwarts_acceptance_mailer.rbi +21 -0
  96. data/spec/test_data/v5.1/expected_headmaster.rbi +60 -196
  97. data/spec/test_data/v5.1/expected_internal_metadata.rbi +42 -194
  98. data/spec/test_data/v5.1/expected_potion.rbi +51 -194
  99. data/spec/test_data/v5.1/expected_robe.rbi +51 -196
  100. data/spec/test_data/v5.1/expected_schema_migration.rbi +42 -194
  101. data/spec/test_data/v5.1/expected_school.rbi +51 -196
  102. data/spec/test_data/v5.1/expected_spell.rbi +42 -196
  103. data/spec/test_data/v5.1/expected_spell/habtm_spell_books.rbi +60 -196
  104. data/spec/test_data/v5.1/expected_spell_book.rbi +86 -221
  105. data/spec/test_data/v5.1/expected_spell_book/habtm_spells.rbi +60 -196
  106. data/spec/test_data/v5.1/expected_squib.rbi +132 -270
  107. data/spec/test_data/v5.1/expected_subject.rbi +42 -196
  108. data/spec/test_data/v5.1/expected_subject/habtm_wizards.rbi +60 -196
  109. data/spec/test_data/v5.1/expected_wand.rbi +84 -231
  110. data/spec/test_data/v5.1/expected_wizard.rbi +132 -270
  111. data/spec/test_data/v5.1/expected_wizard/habtm_subjects.rbi +60 -196
  112. data/spec/test_data/v5.1/expected_wizard_wo_spellbook.rbi +132 -270
  113. data/spec/test_data/v5.2/expected_active_record_base.rbi +2 -2
  114. data/spec/test_data/v5.2/expected_active_record_relation.rbi +2 -2
  115. data/spec/test_data/v5.2/expected_attachment.rbi +60 -194
  116. data/spec/test_data/v5.2/expected_blob.rbi +80 -214
  117. data/spec/test_data/v5.2/expected_custom_application_job.rbi +21 -0
  118. data/spec/test_data/v5.2/expected_custom_application_mailer.rbi +6 -0
  119. data/spec/test_data/v5.2/expected_custom_award_house_point_hourglasses.rbi +21 -0
  120. data/spec/test_data/v5.2/expected_custom_daily_prophet_mailer.rbi +8 -0
  121. data/spec/test_data/v5.2/expected_custom_hogwarts_acceptance_mailer.rbi +21 -0
  122. data/spec/test_data/v5.2/expected_headmaster.rbi +60 -196
  123. data/spec/test_data/v5.2/expected_internal_metadata.rbi +42 -194
  124. data/spec/test_data/v5.2/expected_potion.rbi +51 -194
  125. data/spec/test_data/v5.2/expected_robe.rbi +51 -196
  126. data/spec/test_data/v5.2/expected_schema_migration.rbi +42 -194
  127. data/spec/test_data/v5.2/expected_school.rbi +51 -196
  128. data/spec/test_data/v5.2/expected_spell.rbi +42 -196
  129. data/spec/test_data/v5.2/expected_spell/habtm_spell_books.rbi +60 -196
  130. data/spec/test_data/v5.2/expected_spell_book.rbi +86 -221
  131. data/spec/test_data/v5.2/expected_spell_book/habtm_spells.rbi +60 -196
  132. data/spec/test_data/v5.2/expected_squib.rbi +156 -276
  133. data/spec/test_data/v5.2/expected_subject.rbi +42 -196
  134. data/spec/test_data/v5.2/expected_subject/habtm_wizards.rbi +60 -196
  135. data/spec/test_data/v5.2/expected_wand.rbi +84 -231
  136. data/spec/test_data/v5.2/expected_wizard.rbi +156 -276
  137. data/spec/test_data/v5.2/expected_wizard/habtm_subjects.rbi +60 -196
  138. data/spec/test_data/v5.2/expected_wizard_wo_spellbook.rbi +156 -276
  139. data/spec/test_data/v6.0/expected_active_record_base.rbi +2 -2
  140. data/spec/test_data/v6.0/expected_active_record_relation.rbi +10 -10
  141. data/spec/test_data/v6.0/expected_attachment.rbi +60 -218
  142. data/spec/test_data/v6.0/expected_blob.rbi +80 -238
  143. data/spec/test_data/v6.0/expected_custom_application_job.rbi +21 -0
  144. data/spec/test_data/v6.0/expected_custom_application_mailer.rbi +6 -0
  145. data/spec/test_data/v6.0/expected_custom_award_house_point_hourglasses.rbi +21 -0
  146. data/spec/test_data/v6.0/expected_custom_daily_prophet_mailer.rbi +8 -0
  147. data/spec/test_data/v6.0/expected_custom_hogwarts_acceptance_mailer.rbi +21 -0
  148. data/spec/test_data/v6.0/expected_headmaster.rbi +60 -220
  149. data/spec/test_data/v6.0/expected_internal_metadata.rbi +42 -218
  150. data/spec/test_data/v6.0/expected_potion.rbi +51 -218
  151. data/spec/test_data/v6.0/expected_robe.rbi +51 -220
  152. data/spec/test_data/v6.0/expected_routes.rbi +14 -7
  153. data/spec/test_data/v6.0/expected_schema_migration.rbi +42 -218
  154. data/spec/test_data/v6.0/expected_school.rbi +51 -220
  155. data/spec/test_data/v6.0/expected_spell.rbi +42 -220
  156. data/spec/test_data/v6.0/expected_spell/habtm_spell_books.rbi +60 -220
  157. data/spec/test_data/v6.0/expected_spell_book.rbi +98 -257
  158. data/spec/test_data/v6.0/expected_spell_book/habtm_spells.rbi +60 -220
  159. data/spec/test_data/v6.0/expected_squib.rbi +182 -326
  160. data/spec/test_data/v6.0/expected_subject.rbi +42 -220
  161. data/spec/test_data/v6.0/expected_subject/habtm_wizards.rbi +60 -220
  162. data/spec/test_data/v6.0/expected_wand.rbi +100 -271
  163. data/spec/test_data/v6.0/expected_wizard.rbi +182 -326
  164. data/spec/test_data/v6.0/expected_wizard/habtm_subjects.rbi +60 -220
  165. data/spec/test_data/v6.0/expected_wizard_wo_spellbook.rbi +182 -326
  166. metadata +46 -11
  167. data/lib/bundled_rbi/parameters.rbi +0 -28
  168. data/lib/sorbet-rails/custom_types/boolean_string.rb +0 -42
  169. data/lib/sorbet-rails/custom_types/integer_string.rb +0 -45
  170. data/lib/sorbet-rails/rails_mixins/custom_params_methods.rb +0 -57
  171. data/spec/boolean_string_spec.rb +0 -59
  172. data/spec/custom_params_methods_spec.rb +0 -138
  173. data/spec/integer_string_spec.rb +0 -46
@@ -3,8 +3,6 @@
3
3
 
4
4
  # typed: strong
5
5
  module Wand::EnumInstanceMethods
6
- extend T::Sig
7
-
8
6
  sig { returns(T::Boolean) }
9
7
  def phoenix_feather?; end
10
8
 
@@ -36,8 +34,6 @@ module Wand::ActiveRelation_WhereNot
36
34
  end
37
35
 
38
36
  module Wand::GeneratedAttributeMethods
39
- extend T::Sig
40
-
41
37
  sig { returns(T::Boolean) }
42
38
  def broken; end
43
39
 
@@ -185,11 +181,18 @@ class Wand::CoreType < T::Enum
185
181
  end
186
182
 
187
183
  module Wand::GeneratedAssociationMethods
188
- extend T::Sig
189
-
190
184
  sig { returns(::Wizard) }
191
185
  def wizard; end
192
186
 
187
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::Wizard).void)).returns(::Wizard) }
188
+ def build_wizard(*args, &block); end
189
+
190
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::Wizard).void)).returns(::Wizard) }
191
+ def create_wizard(*args, &block); end
192
+
193
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::Wizard).void)).returns(::Wizard) }
194
+ def create_wizard!(*args, &block); end
195
+
193
196
  sig { params(value: ::Wizard).void }
194
197
  def wizard=(value); end
195
198
  end
@@ -216,8 +219,7 @@ class Wand < ApplicationRecord
216
219
  include Wand::GeneratedAttributeMethods
217
220
  include Wand::GeneratedAssociationMethods
218
221
  extend Wand::CustomFinderMethods
219
- extend T::Sig
220
- extend T::Generic
222
+ extend Wand::QueryMethodsReturningRelation
221
223
  RelationType = T.type_alias { T.any(Wand::ActiveRecord_Relation, Wand::ActiveRecord_Associations_CollectionProxy, Wand::ActiveRecord_AssociationRelation) }
222
224
 
223
225
  sig { returns(T::Hash[T.any(String, Symbol), Integer]) }
@@ -247,146 +249,121 @@ class Wand < ApplicationRecord
247
249
  sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
248
250
  def self.unicorn_tail_hair(*args); end
249
251
 
250
- sig { returns(Wand::ActiveRecord_Relation) }
251
- def self.all; end
252
-
253
- sig { params(block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_Relation) }
254
- def self.unscoped(&block); end
255
-
256
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
257
- def self.select(*args); end
258
-
259
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
260
- def self.reselect(*args); end
261
-
262
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
263
- def self.order(*args); end
264
-
265
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
266
- def self.reorder(*args); end
267
-
268
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
269
- def self.group(*args); end
270
-
271
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
272
- def self.limit(*args); end
273
-
274
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
275
- def self.offset(*args); end
276
-
277
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
278
- def self.joins(*args); end
279
-
280
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
281
- def self.left_joins(*args); end
282
-
283
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
284
- def self.left_outer_joins(*args); end
285
-
286
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
287
- def self.where(*args); end
288
-
289
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
290
- def self.rewhere(*args); end
291
-
292
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
293
- def self.preload(*args); end
294
-
295
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
296
- def self.extract_associated(*args); end
252
+ sig { returns(T.nilable(Wand::CoreType)) }
253
+ def typed_core_type; end
297
254
 
298
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
299
- def self.eager_load(*args); end
255
+ sig { params(value: T.nilable(Wand::CoreType)).void }
256
+ def typed_core_type=(value); end
300
257
 
301
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
302
- def self.includes(*args); end
258
+ sig { returns(T::Array[Wand]) }
259
+ def self.mythicals; end
260
+ end
303
261
 
304
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
305
- def self.from(*args); end
262
+ class Wand::ActiveRecord_Relation < ActiveRecord::Relation
263
+ include Wand::ActiveRelation_WhereNot
264
+ include Wand::CustomFinderMethods
265
+ include Wand::QueryMethodsReturningRelation
266
+ Elem = type_member(fixed: Wand)
306
267
 
307
268
  sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
308
- def self.lock(*args); end
269
+ def basilisk_horn(*args); end
309
270
 
310
271
  sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
311
- def self.readonly(*args); end
272
+ def dragon_heartstring(*args); end
312
273
 
313
274
  sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
314
- def self.or(*args); end
275
+ def not_basilisk_horn(*args); end
315
276
 
316
277
  sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
317
- def self.having(*args); end
278
+ def not_dragon_heartstring(*args); end
318
279
 
319
280
  sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
320
- def self.create_with(*args); end
281
+ def not_phoenix_feather(*args); end
321
282
 
322
283
  sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
323
- def self.distinct(*args); end
284
+ def not_unicorn_tail_hair(*args); end
324
285
 
325
286
  sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
326
- def self.references(*args); end
287
+ def phoenix_feather(*args); end
327
288
 
328
289
  sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
329
- def self.none(*args); end
290
+ def unicorn_tail_hair(*args); end
291
+ end
330
292
 
331
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
332
- def self.unscope(*args); end
293
+ class Wand::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
294
+ include Wand::ActiveRelation_WhereNot
295
+ include Wand::CustomFinderMethods
296
+ include Wand::QueryMethodsReturningAssociationRelation
297
+ Elem = type_member(fixed: Wand)
333
298
 
334
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
335
- def self.optimizer_hints(*args); end
299
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
300
+ def basilisk_horn(*args); end
336
301
 
337
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
338
- def self.merge(*args); end
302
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
303
+ def dragon_heartstring(*args); end
339
304
 
340
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
341
- def self.except(*args); end
305
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
306
+ def not_basilisk_horn(*args); end
342
307
 
343
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
344
- def self.only(*args); end
308
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
309
+ def not_dragon_heartstring(*args); end
345
310
 
346
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_Relation) }
347
- def self.extending(*args, &block); end
311
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
312
+ def not_phoenix_feather(*args); end
348
313
 
349
- sig { returns(T.nilable(Wand::CoreType)) }
350
- def typed_core_type; end
314
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
315
+ def not_unicorn_tail_hair(*args); end
351
316
 
352
- sig { params(value: T.nilable(Wand::CoreType)).void }
353
- def typed_core_type=(value); end
317
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
318
+ def phoenix_feather(*args); end
354
319
 
355
- sig { returns(T::Array[Wand]) }
356
- def self.mythicals; end
320
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
321
+ def unicorn_tail_hair(*args); end
357
322
  end
358
323
 
359
- class Wand::ActiveRecord_Relation < ActiveRecord::Relation
360
- include Wand::ActiveRelation_WhereNot
324
+ class Wand::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
361
325
  include Wand::CustomFinderMethods
362
- extend T::Sig
363
- extend T::Generic
326
+ include Wand::QueryMethodsReturningAssociationRelation
364
327
  Elem = type_member(fixed: Wand)
365
328
 
366
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
329
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
367
330
  def basilisk_horn(*args); end
368
331
 
369
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
332
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
370
333
  def dragon_heartstring(*args); end
371
334
 
372
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
335
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
373
336
  def not_basilisk_horn(*args); end
374
337
 
375
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
338
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
376
339
  def not_dragon_heartstring(*args); end
377
340
 
378
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
341
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
379
342
  def not_phoenix_feather(*args); end
380
343
 
381
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
344
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
382
345
  def not_unicorn_tail_hair(*args); end
383
346
 
384
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
347
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
385
348
  def phoenix_feather(*args); end
386
349
 
387
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
350
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
388
351
  def unicorn_tail_hair(*args); end
389
352
 
353
+ sig { params(records: T.any(Wand, T::Array[Wand])).returns(T.self_type) }
354
+ def <<(*records); end
355
+
356
+ sig { params(records: T.any(Wand, T::Array[Wand])).returns(T.self_type) }
357
+ def append(*records); end
358
+
359
+ sig { params(records: T.any(Wand, T::Array[Wand])).returns(T.self_type) }
360
+ def push(*records); end
361
+
362
+ sig { params(records: T.any(Wand, T::Array[Wand])).returns(T.self_type) }
363
+ def concat(*records); end
364
+ end
365
+
366
+ module Wand::QueryMethodsReturningRelation
390
367
  sig { returns(Wand::ActiveRecord_Relation) }
391
368
  def all; end
392
369
 
@@ -485,173 +462,25 @@ class Wand::ActiveRecord_Relation < ActiveRecord::Relation
485
462
 
486
463
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_Relation) }
487
464
  def extending(*args, &block); end
488
- end
489
-
490
- class Wand::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
491
- include Wand::ActiveRelation_WhereNot
492
- include Wand::CustomFinderMethods
493
- extend T::Sig
494
- extend T::Generic
495
- Elem = type_member(fixed: Wand)
496
-
497
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
498
- def basilisk_horn(*args); end
499
-
500
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
501
- def dragon_heartstring(*args); end
502
-
503
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
504
- def not_basilisk_horn(*args); end
505
465
 
506
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
507
- def not_dragon_heartstring(*args); end
508
-
509
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
510
- def not_phoenix_feather(*args); end
511
-
512
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
513
- def not_unicorn_tail_hair(*args); end
514
-
515
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
516
- def phoenix_feather(*args); end
517
-
518
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
519
- def unicorn_tail_hair(*args); end
520
-
521
- sig { returns(Wand::ActiveRecord_AssociationRelation) }
522
- def all; end
523
-
524
- sig { params(block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_AssociationRelation) }
525
- def unscoped(&block); end
526
-
527
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
528
- def select(*args); end
529
-
530
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
531
- def reselect(*args); end
532
-
533
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
534
- def order(*args); end
535
-
536
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
537
- def reorder(*args); end
538
-
539
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
540
- def group(*args); end
541
-
542
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
543
- def limit(*args); end
544
-
545
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
546
- def offset(*args); end
547
-
548
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
549
- def joins(*args); end
550
-
551
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
552
- def left_joins(*args); end
553
-
554
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
555
- def left_outer_joins(*args); end
556
-
557
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
558
- def where(*args); end
559
-
560
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
561
- def rewhere(*args); end
562
-
563
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
564
- def preload(*args); end
565
-
566
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
567
- def extract_associated(*args); end
568
-
569
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
570
- def eager_load(*args); end
571
-
572
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
573
- def includes(*args); end
574
-
575
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
576
- def from(*args); end
577
-
578
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
579
- def lock(*args); end
580
-
581
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
582
- def readonly(*args); end
583
-
584
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
585
- def or(*args); end
586
-
587
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
588
- def having(*args); end
589
-
590
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
591
- def create_with(*args); end
592
-
593
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
594
- def distinct(*args); end
595
-
596
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
597
- def references(*args); end
598
-
599
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
600
- def none(*args); end
601
-
602
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
603
- def unscope(*args); end
604
-
605
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
606
- def optimizer_hints(*args); end
607
-
608
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
609
- def merge(*args); end
610
-
611
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
612
- def except(*args); end
613
-
614
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
615
- def only(*args); end
616
-
617
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_AssociationRelation) }
618
- def extending(*args, &block); end
466
+ sig do
467
+ params(
468
+ of: T.nilable(Integer),
469
+ start: T.nilable(Integer),
470
+ finish: T.nilable(Integer),
471
+ load: T.nilable(T::Boolean),
472
+ error_on_ignore: T.nilable(T::Boolean),
473
+ block: T.nilable(T.proc.params(e: Wand::ActiveRecord_Relation).void)
474
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
475
+ end
476
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
619
477
  end
620
478
 
621
- class Wand::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
622
- include Wand::CustomFinderMethods
623
- extend T::Sig
624
- extend T::Generic
625
- Elem = type_member(fixed: Wand)
626
-
627
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
628
- def basilisk_horn(*args); end
629
-
630
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
631
- def dragon_heartstring(*args); end
632
-
633
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
634
- def not_basilisk_horn(*args); end
635
-
636
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
637
- def not_dragon_heartstring(*args); end
638
-
639
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
640
- def not_phoenix_feather(*args); end
641
-
642
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
643
- def not_unicorn_tail_hair(*args); end
644
-
645
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
646
- def phoenix_feather(*args); end
647
-
648
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
649
- def unicorn_tail_hair(*args); end
650
-
479
+ module Wand::QueryMethodsReturningAssociationRelation
651
480
  sig { returns(Wand::ActiveRecord_AssociationRelation) }
652
481
  def all; end
653
482
 
654
- sig { params(block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_AssociationRelation) }
483
+ sig { params(block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_Relation) }
655
484
  def unscoped(&block); end
656
485
 
657
486
  sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
@@ -747,15 +576,15 @@ class Wand::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associatio
747
576
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_AssociationRelation) }
748
577
  def extending(*args, &block); end
749
578
 
750
- sig { params(records: T.any(Wand, T::Array[Wand])).returns(T.self_type) }
751
- def <<(*records); end
752
-
753
- sig { params(records: T.any(Wand, T::Array[Wand])).returns(T.self_type) }
754
- def append(*records); end
755
-
756
- sig { params(records: T.any(Wand, T::Array[Wand])).returns(T.self_type) }
757
- def push(*records); end
758
-
759
- sig { params(records: T.any(Wand, T::Array[Wand])).returns(T.self_type) }
760
- def concat(*records); end
579
+ sig do
580
+ params(
581
+ of: T.nilable(Integer),
582
+ start: T.nilable(Integer),
583
+ finish: T.nilable(Integer),
584
+ load: T.nilable(T::Boolean),
585
+ error_on_ignore: T.nilable(T::Boolean),
586
+ block: T.nilable(T.proc.params(e: Wand::ActiveRecord_AssociationRelation).void)
587
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
588
+ end
589
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
761
590
  end