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 Squib::EnumInstanceMethods
6
- extend T::Sig
7
-
8
6
  sig { returns(T::Boolean) }
9
7
  def broom_nimbus?; end
10
8
 
@@ -114,8 +112,6 @@ module Squib::ActiveRelation_WhereNot
114
112
  end
115
113
 
116
114
  module Squib::GeneratedAttributeMethods
117
- extend T::Sig
118
-
119
115
  sig { returns(T.nilable(String)) }
120
116
  def broom; end
121
117
 
@@ -253,11 +249,18 @@ module Squib::GeneratedAttributeMethods
253
249
  end
254
250
 
255
251
  module Squib::GeneratedAssociationMethods
256
- extend T::Sig
257
-
258
252
  sig { returns(T.nilable(::School)) }
259
253
  def school; end
260
254
 
255
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::School).void)).returns(::School) }
256
+ def build_school(*args, &block); end
257
+
258
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::School).void)).returns(::School) }
259
+ def create_school(*args, &block); end
260
+
261
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::School).void)).returns(::School) }
262
+ def create_school!(*args, &block); end
263
+
261
264
  sig { params(value: T.nilable(::School)).void }
262
265
  def school=(value); end
263
266
 
@@ -282,6 +285,15 @@ module Squib::GeneratedAssociationMethods
282
285
  sig { returns(T.nilable(::Wand)) }
283
286
  def wand; end
284
287
 
288
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::Wand).void)).returns(::Wand) }
289
+ def build_wand(*args, &block); end
290
+
291
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::Wand).void)).returns(::Wand) }
292
+ def create_wand(*args, &block); end
293
+
294
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::Wand).void)).returns(::Wand) }
295
+ def create_wand!(*args, &block); end
296
+
285
297
  sig { params(value: T.nilable(::Wand)).void }
286
298
  def wand=(value); end
287
299
  end
@@ -308,8 +320,7 @@ class Squib < Wizard
308
320
  include Squib::GeneratedAttributeMethods
309
321
  include Squib::GeneratedAssociationMethods
310
322
  extend Squib::CustomFinderMethods
311
- extend T::Sig
312
- extend T::Generic
323
+ extend Squib::QueryMethodsReturningRelation
313
324
  RelationType = T.type_alias { T.any(Squib::ActiveRecord_Relation, Squib::ActiveRecord_Associations_CollectionProxy, Squib::ActiveRecord_AssociationRelation) }
314
325
 
315
326
  sig { returns(T::Hash[T.any(String, Symbol), String]) }
@@ -383,97 +394,12 @@ class Squib < Wizard
383
394
 
384
395
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
385
396
  def self.recent(*args); end
386
-
387
- sig { returns(Squib::ActiveRecord_Relation) }
388
- def self.all; end
389
-
390
- sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
391
- def self.unscoped(&block); end
392
-
393
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
394
- def self.select(*args); end
395
-
396
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
397
- def self.order(*args); end
398
-
399
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
400
- def self.reorder(*args); end
401
-
402
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
403
- def self.group(*args); end
404
-
405
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
406
- def self.limit(*args); end
407
-
408
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
409
- def self.offset(*args); end
410
-
411
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
412
- def self.joins(*args); end
413
-
414
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
415
- def self.left_joins(*args); end
416
-
417
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
418
- def self.left_outer_joins(*args); end
419
-
420
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
421
- def self.where(*args); end
422
-
423
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
424
- def self.rewhere(*args); end
425
-
426
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
427
- def self.preload(*args); end
428
-
429
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
430
- def self.eager_load(*args); end
431
-
432
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
433
- def self.includes(*args); end
434
-
435
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
436
- def self.from(*args); end
437
-
438
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
439
- def self.lock(*args); end
440
-
441
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
442
- def self.readonly(*args); end
443
-
444
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
445
- def self.or(*args); end
446
-
447
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
448
- def self.having(*args); end
449
-
450
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
451
- def self.create_with(*args); end
452
-
453
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
454
- def self.distinct(*args); end
455
-
456
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
457
- def self.references(*args); end
458
-
459
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
460
- def self.none(*args); end
461
-
462
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
463
- def self.unscope(*args); end
464
-
465
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
466
- def self.except(*args); end
467
-
468
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
469
- def self.extending(*args, &block); end
470
397
  end
471
398
 
472
399
  class Squib::ActiveRecord_Relation < ActiveRecord::Relation
473
400
  include Squib::ActiveRelation_WhereNot
474
401
  include Squib::CustomFinderMethods
475
- extend T::Sig
476
- extend T::Generic
402
+ include Squib::QueryMethodsReturningRelation
477
403
  Elem = type_member(fixed: Squib)
478
404
 
479
405
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
@@ -529,97 +455,72 @@ class Squib::ActiveRecord_Relation < ActiveRecord::Relation
529
455
 
530
456
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
531
457
  def recent(*args); end
458
+ end
532
459
 
533
- sig { returns(Squib::ActiveRecord_Relation) }
534
- def all; end
535
-
536
- sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
537
- def unscoped(&block); end
538
-
539
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
540
- def select(*args); end
541
-
542
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
543
- def order(*args); end
544
-
545
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
546
- def reorder(*args); end
547
-
548
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
549
- def group(*args); end
550
-
551
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
552
- def limit(*args); end
553
-
554
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
555
- def offset(*args); end
556
-
557
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
558
- def joins(*args); end
559
-
560
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
561
- def left_joins(*args); end
460
+ class Squib::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
461
+ include Squib::ActiveRelation_WhereNot
462
+ include Squib::CustomFinderMethods
463
+ include Squib::QueryMethodsReturningAssociationRelation
464
+ Elem = type_member(fixed: Squib)
562
465
 
563
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
564
- def left_outer_joins(*args); end
466
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
467
+ def Gryffindor(*args); end
565
468
 
566
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
567
- def where(*args); end
469
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
470
+ def Hagrid(*args); end
568
471
 
569
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
570
- def rewhere(*args); end
472
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
473
+ def Hufflepuff(*args); end
571
474
 
572
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
573
- def preload(*args); end
475
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
476
+ def Ravenclaw(*args); end
574
477
 
575
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
576
- def eager_load(*args); end
478
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
479
+ def Slytherin(*args); end
577
480
 
578
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
579
- def includes(*args); end
481
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
482
+ def black_hair(*args); end
580
483
 
581
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
582
- def from(*args); end
484
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
485
+ def blonde_hair(*args); end
583
486
 
584
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
585
- def lock(*args); end
487
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
488
+ def broom_firebolt(*args); end
586
489
 
587
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
588
- def readonly(*args); end
490
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
491
+ def broom_nimbus(*args); end
589
492
 
590
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
591
- def or(*args); end
493
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
494
+ def brown_hair(*args); end
592
495
 
593
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
594
- def having(*args); end
496
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
497
+ def color_blue_eyes(*args); end
595
498
 
596
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
597
- def create_with(*args); end
499
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
500
+ def color_brown_eyes(*args); end
598
501
 
599
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
600
- def distinct(*args); end
502
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
503
+ def color_green_eyes(*args); end
601
504
 
602
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
603
- def references(*args); end
505
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
506
+ def quidditch_beater(*args); end
604
507
 
605
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
606
- def none(*args); end
508
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
509
+ def quidditch_chaser(*args); end
607
510
 
608
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
609
- def unscope(*args); end
511
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
512
+ def quidditch_keeper(*args); end
610
513
 
611
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
612
- def except(*args); end
514
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
515
+ def quidditch_seeker(*args); end
613
516
 
614
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
615
- def extending(*args, &block); end
517
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
518
+ def recent(*args); end
616
519
  end
617
520
 
618
- class Squib::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
619
- include Squib::ActiveRelation_WhereNot
521
+ class Squib::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
620
522
  include Squib::CustomFinderMethods
621
- extend T::Sig
622
- extend T::Generic
523
+ include Squib::QueryMethodsReturningAssociationRelation
623
524
  Elem = type_member(fixed: Squib)
624
525
 
625
526
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
@@ -676,155 +577,122 @@ class Squib::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelatio
676
577
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
677
578
  def recent(*args); end
678
579
 
679
- sig { returns(Squib::ActiveRecord_AssociationRelation) }
580
+ sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
581
+ def <<(*records); end
582
+
583
+ sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
584
+ def append(*records); end
585
+
586
+ sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
587
+ def push(*records); end
588
+
589
+ sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
590
+ def concat(*records); end
591
+ end
592
+
593
+ module Squib::QueryMethodsReturningRelation
594
+ sig { returns(Squib::ActiveRecord_Relation) }
680
595
  def all; end
681
596
 
682
- sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_AssociationRelation) }
597
+ sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
683
598
  def unscoped(&block); end
684
599
 
685
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
600
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
686
601
  def select(*args); end
687
602
 
688
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
603
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
689
604
  def order(*args); end
690
605
 
691
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
606
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
692
607
  def reorder(*args); end
693
608
 
694
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
609
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
695
610
  def group(*args); end
696
611
 
697
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
612
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
698
613
  def limit(*args); end
699
614
 
700
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
615
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
701
616
  def offset(*args); end
702
617
 
703
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
618
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
704
619
  def joins(*args); end
705
620
 
706
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
621
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
707
622
  def left_joins(*args); end
708
623
 
709
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
624
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
710
625
  def left_outer_joins(*args); end
711
626
 
712
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
627
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
713
628
  def where(*args); end
714
629
 
715
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
630
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
716
631
  def rewhere(*args); end
717
632
 
718
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
633
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
719
634
  def preload(*args); end
720
635
 
721
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
636
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
722
637
  def eager_load(*args); end
723
638
 
724
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
639
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
725
640
  def includes(*args); end
726
641
 
727
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
642
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
728
643
  def from(*args); end
729
644
 
730
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
645
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
731
646
  def lock(*args); end
732
647
 
733
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
648
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
734
649
  def readonly(*args); end
735
650
 
736
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
651
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
737
652
  def or(*args); end
738
653
 
739
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
654
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
740
655
  def having(*args); end
741
656
 
742
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
657
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
743
658
  def create_with(*args); end
744
659
 
745
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
660
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
746
661
  def distinct(*args); end
747
662
 
748
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
663
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
749
664
  def references(*args); end
750
665
 
751
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
666
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
752
667
  def none(*args); end
753
668
 
754
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
669
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
755
670
  def unscope(*args); end
756
671
 
757
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
672
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
758
673
  def except(*args); end
759
674
 
760
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_AssociationRelation) }
675
+ sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
761
676
  def extending(*args, &block); end
762
- end
763
-
764
- class Squib::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
765
- include Squib::CustomFinderMethods
766
- extend T::Sig
767
- extend T::Generic
768
- Elem = type_member(fixed: Squib)
769
-
770
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
771
- def Gryffindor(*args); end
772
-
773
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
774
- def Hagrid(*args); end
775
-
776
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
777
- def Hufflepuff(*args); end
778
-
779
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
780
- def Ravenclaw(*args); end
781
-
782
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
783
- def Slytherin(*args); end
784
-
785
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
786
- def black_hair(*args); end
787
-
788
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
789
- def blonde_hair(*args); end
790
-
791
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
792
- def broom_firebolt(*args); end
793
-
794
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
795
- def broom_nimbus(*args); end
796
677
 
797
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
798
- def brown_hair(*args); end
799
-
800
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
801
- def color_blue_eyes(*args); end
802
-
803
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
804
- def color_brown_eyes(*args); end
805
-
806
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
807
- def color_green_eyes(*args); end
808
-
809
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
810
- def quidditch_beater(*args); end
811
-
812
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
813
- def quidditch_chaser(*args); end
814
-
815
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
816
- def quidditch_keeper(*args); end
817
-
818
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
819
- def quidditch_seeker(*args); end
820
-
821
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
822
- def recent(*args); end
678
+ sig do
679
+ params(
680
+ of: T.nilable(Integer),
681
+ start: T.nilable(Integer),
682
+ finish: T.nilable(Integer),
683
+ load: T.nilable(T::Boolean),
684
+ error_on_ignore: T.nilable(T::Boolean),
685
+ block: T.nilable(T.proc.params(e: Squib::ActiveRecord_Relation).void)
686
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
687
+ end
688
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
689
+ end
823
690
 
691
+ module Squib::QueryMethodsReturningAssociationRelation
824
692
  sig { returns(Squib::ActiveRecord_AssociationRelation) }
825
693
  def all; end
826
694
 
827
- sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_AssociationRelation) }
695
+ sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
828
696
  def unscoped(&block); end
829
697
 
830
698
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
@@ -905,15 +773,15 @@ class Squib::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associati
905
773
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_AssociationRelation) }
906
774
  def extending(*args, &block); end
907
775
 
908
- sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
909
- def <<(*records); end
910
-
911
- sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
912
- def append(*records); end
913
-
914
- sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
915
- def push(*records); end
916
-
917
- sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
918
- def concat(*records); end
776
+ sig do
777
+ params(
778
+ of: T.nilable(Integer),
779
+ start: T.nilable(Integer),
780
+ finish: T.nilable(Integer),
781
+ load: T.nilable(T::Boolean),
782
+ error_on_ignore: T.nilable(T::Boolean),
783
+ block: T.nilable(T.proc.params(e: Squib::ActiveRecord_AssociationRelation).void)
784
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
785
+ end
786
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
919
787
  end