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,12 +249,10 @@ module Squib::GeneratedAttributeMethods
253
249
  end
254
250
 
255
251
  module Squib::GeneratedAssociationMethods
256
- extend T::Sig
257
-
258
252
  sig { returns(::ActiveStorage::Attachment::ActiveRecord_Associations_CollectionProxy) }
259
253
  def hats_attachments; end
260
254
 
261
- sig { returns(T::Array[Integer]) }
255
+ sig { returns(T::Array[T.untyped]) }
262
256
  def hats_attachment_ids; end
263
257
 
264
258
  sig { params(value: T::Enumerable[::ActiveStorage::Attachment]).void }
@@ -267,7 +261,7 @@ module Squib::GeneratedAssociationMethods
267
261
  sig { returns(::ActiveStorage::Blob::ActiveRecord_Associations_CollectionProxy) }
268
262
  def hats_blobs; end
269
263
 
270
- sig { returns(T::Array[Integer]) }
264
+ sig { returns(T::Array[T.untyped]) }
271
265
  def hats_blob_ids; end
272
266
 
273
267
  sig { params(value: T::Enumerable[::ActiveStorage::Blob]).void }
@@ -276,18 +270,45 @@ module Squib::GeneratedAssociationMethods
276
270
  sig { returns(T.nilable(::School)) }
277
271
  def school; end
278
272
 
273
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::School).void)).returns(::School) }
274
+ def build_school(*args, &block); end
275
+
276
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::School).void)).returns(::School) }
277
+ def create_school(*args, &block); end
278
+
279
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::School).void)).returns(::School) }
280
+ def create_school!(*args, &block); end
281
+
279
282
  sig { params(value: T.nilable(::School)).void }
280
283
  def school=(value); end
281
284
 
282
285
  sig { returns(T.nilable(::ActiveStorage::Attachment)) }
283
286
  def school_photo_attachment; end
284
287
 
288
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void)).returns(::ActiveStorage::Attachment) }
289
+ def build_school_photo_attachment(*args, &block); end
290
+
291
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void)).returns(::ActiveStorage::Attachment) }
292
+ def create_school_photo_attachment(*args, &block); end
293
+
294
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void)).returns(::ActiveStorage::Attachment) }
295
+ def create_school_photo_attachment!(*args, &block); end
296
+
285
297
  sig { params(value: T.nilable(::ActiveStorage::Attachment)).void }
286
298
  def school_photo_attachment=(value); end
287
299
 
288
300
  sig { returns(T.nilable(::ActiveStorage::Blob)) }
289
301
  def school_photo_blob; end
290
302
 
303
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void)).returns(::ActiveStorage::Blob) }
304
+ def build_school_photo_blob(*args, &block); end
305
+
306
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void)).returns(::ActiveStorage::Blob) }
307
+ def create_school_photo_blob(*args, &block); end
308
+
309
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void)).returns(::ActiveStorage::Blob) }
310
+ def create_school_photo_blob!(*args, &block); end
311
+
291
312
  sig { params(value: T.nilable(::ActiveStorage::Blob)).void }
292
313
  def school_photo_blob=(value); end
293
314
 
@@ -312,6 +333,15 @@ module Squib::GeneratedAssociationMethods
312
333
  sig { returns(T.nilable(::Wand)) }
313
334
  def wand; end
314
335
 
336
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::Wand).void)).returns(::Wand) }
337
+ def build_wand(*args, &block); end
338
+
339
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::Wand).void)).returns(::Wand) }
340
+ def create_wand(*args, &block); end
341
+
342
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::Wand).void)).returns(::Wand) }
343
+ def create_wand!(*args, &block); end
344
+
315
345
  sig { params(value: T.nilable(::Wand)).void }
316
346
  def wand=(value); end
317
347
  end
@@ -338,8 +368,7 @@ class Squib < Wizard
338
368
  include Squib::GeneratedAttributeMethods
339
369
  include Squib::GeneratedAssociationMethods
340
370
  extend Squib::CustomFinderMethods
341
- extend T::Sig
342
- extend T::Generic
371
+ extend Squib::QueryMethodsReturningRelation
343
372
  RelationType = T.type_alias { T.any(Squib::ActiveRecord_Relation, Squib::ActiveRecord_Associations_CollectionProxy, Squib::ActiveRecord_AssociationRelation) }
344
373
 
345
374
  sig { returns(T::Hash[T.any(String, Symbol), String]) }
@@ -419,100 +448,12 @@ class Squib < Wizard
419
448
 
420
449
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
421
450
  def self.with_attached_school_photo(*args); end
422
-
423
- sig { returns(Squib::ActiveRecord_Relation) }
424
- def self.all; end
425
-
426
- sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
427
- def self.unscoped(&block); end
428
-
429
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
430
- def self.select(*args); end
431
-
432
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
433
- def self.order(*args); end
434
-
435
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
436
- def self.reorder(*args); end
437
-
438
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
439
- def self.group(*args); end
440
-
441
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
442
- def self.limit(*args); end
443
-
444
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
445
- def self.offset(*args); end
446
-
447
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
448
- def self.joins(*args); end
449
-
450
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
451
- def self.left_joins(*args); end
452
-
453
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
454
- def self.left_outer_joins(*args); end
455
-
456
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
457
- def self.where(*args); end
458
-
459
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
460
- def self.rewhere(*args); end
461
-
462
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
463
- def self.preload(*args); end
464
-
465
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
466
- def self.eager_load(*args); end
467
-
468
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
469
- def self.includes(*args); end
470
-
471
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
472
- def self.from(*args); end
473
-
474
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
475
- def self.lock(*args); end
476
-
477
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
478
- def self.readonly(*args); end
479
-
480
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
481
- def self.or(*args); end
482
-
483
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
484
- def self.having(*args); end
485
-
486
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
487
- def self.create_with(*args); end
488
-
489
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
490
- def self.distinct(*args); end
491
-
492
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
493
- def self.references(*args); end
494
-
495
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
496
- def self.none(*args); end
497
-
498
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
499
- def self.unscope(*args); end
500
-
501
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
502
- def self.merge(*args); end
503
-
504
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
505
- def self.except(*args); end
506
-
507
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
508
- def self.extending(*args, &block); end
509
451
  end
510
452
 
511
453
  class Squib::ActiveRecord_Relation < ActiveRecord::Relation
512
454
  include Squib::ActiveRelation_WhereNot
513
455
  include Squib::CustomFinderMethods
514
- extend T::Sig
515
- extend T::Generic
456
+ include Squib::QueryMethodsReturningRelation
516
457
  Elem = type_member(fixed: Squib)
517
458
 
518
459
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
@@ -574,100 +515,78 @@ class Squib::ActiveRecord_Relation < ActiveRecord::Relation
574
515
 
575
516
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
576
517
  def with_attached_school_photo(*args); end
518
+ end
577
519
 
578
- sig { returns(Squib::ActiveRecord_Relation) }
579
- def all; end
580
-
581
- sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
582
- def unscoped(&block); end
583
-
584
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
585
- def select(*args); end
586
-
587
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
588
- def order(*args); end
589
-
590
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
591
- def reorder(*args); end
592
-
593
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
594
- def group(*args); end
595
-
596
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
597
- def limit(*args); end
598
-
599
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
600
- def offset(*args); end
601
-
602
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
603
- def joins(*args); end
520
+ class Squib::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
521
+ include Squib::ActiveRelation_WhereNot
522
+ include Squib::CustomFinderMethods
523
+ include Squib::QueryMethodsReturningAssociationRelation
524
+ Elem = type_member(fixed: Squib)
604
525
 
605
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
606
- def left_joins(*args); end
526
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
527
+ def Gryffindor(*args); end
607
528
 
608
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
609
- def left_outer_joins(*args); end
529
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
530
+ def Hagrid(*args); end
610
531
 
611
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
612
- def where(*args); end
532
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
533
+ def Hufflepuff(*args); end
613
534
 
614
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
615
- def rewhere(*args); end
535
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
536
+ def Ravenclaw(*args); end
616
537
 
617
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
618
- def preload(*args); end
538
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
539
+ def Slytherin(*args); end
619
540
 
620
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
621
- def eager_load(*args); end
541
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
542
+ def black_hair(*args); end
622
543
 
623
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
624
- def includes(*args); end
544
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
545
+ def blonde_hair(*args); end
625
546
 
626
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
627
- def from(*args); end
547
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
548
+ def broom_firebolt(*args); end
628
549
 
629
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
630
- def lock(*args); end
550
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
551
+ def broom_nimbus(*args); end
631
552
 
632
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
633
- def readonly(*args); end
553
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
554
+ def brown_hair(*args); end
634
555
 
635
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
636
- def or(*args); end
556
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
557
+ def color_blue_eyes(*args); end
637
558
 
638
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
639
- def having(*args); end
559
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
560
+ def color_brown_eyes(*args); end
640
561
 
641
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
642
- def create_with(*args); end
562
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
563
+ def color_green_eyes(*args); end
643
564
 
644
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
645
- def distinct(*args); end
565
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
566
+ def quidditch_beater(*args); end
646
567
 
647
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
648
- def references(*args); end
568
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
569
+ def quidditch_chaser(*args); end
649
570
 
650
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
651
- def none(*args); end
571
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
572
+ def quidditch_keeper(*args); end
652
573
 
653
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
654
- def unscope(*args); end
574
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
575
+ def quidditch_seeker(*args); end
655
576
 
656
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
657
- def merge(*args); end
577
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
578
+ def recent(*args); end
658
579
 
659
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
660
- def except(*args); end
580
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
581
+ def with_attached_hats(*args); end
661
582
 
662
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
663
- def extending(*args, &block); end
583
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
584
+ def with_attached_school_photo(*args); end
664
585
  end
665
586
 
666
- class Squib::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
667
- include Squib::ActiveRelation_WhereNot
587
+ class Squib::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
668
588
  include Squib::CustomFinderMethods
669
- extend T::Sig
670
- extend T::Generic
589
+ include Squib::QueryMethodsReturningAssociationRelation
671
590
  Elem = type_member(fixed: Squib)
672
591
 
673
592
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
@@ -730,164 +649,125 @@ class Squib::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelatio
730
649
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
731
650
  def with_attached_school_photo(*args); end
732
651
 
733
- sig { returns(Squib::ActiveRecord_AssociationRelation) }
652
+ sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
653
+ def <<(*records); end
654
+
655
+ sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
656
+ def append(*records); end
657
+
658
+ sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
659
+ def push(*records); end
660
+
661
+ sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
662
+ def concat(*records); end
663
+ end
664
+
665
+ module Squib::QueryMethodsReturningRelation
666
+ sig { returns(Squib::ActiveRecord_Relation) }
734
667
  def all; end
735
668
 
736
- sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_AssociationRelation) }
669
+ sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
737
670
  def unscoped(&block); end
738
671
 
739
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
672
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
740
673
  def select(*args); end
741
674
 
742
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
675
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
743
676
  def order(*args); end
744
677
 
745
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
678
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
746
679
  def reorder(*args); end
747
680
 
748
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
681
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
749
682
  def group(*args); end
750
683
 
751
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
684
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
752
685
  def limit(*args); end
753
686
 
754
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
687
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
755
688
  def offset(*args); end
756
689
 
757
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
690
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
758
691
  def joins(*args); end
759
692
 
760
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
693
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
761
694
  def left_joins(*args); end
762
695
 
763
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
696
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
764
697
  def left_outer_joins(*args); end
765
698
 
766
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
699
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
767
700
  def where(*args); end
768
701
 
769
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
702
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
770
703
  def rewhere(*args); end
771
704
 
772
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
705
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
773
706
  def preload(*args); end
774
707
 
775
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
708
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
776
709
  def eager_load(*args); end
777
710
 
778
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
711
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
779
712
  def includes(*args); end
780
713
 
781
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
714
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
782
715
  def from(*args); end
783
716
 
784
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
717
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
785
718
  def lock(*args); end
786
719
 
787
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
720
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
788
721
  def readonly(*args); end
789
722
 
790
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
723
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
791
724
  def or(*args); end
792
725
 
793
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
726
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
794
727
  def having(*args); end
795
728
 
796
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
729
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
797
730
  def create_with(*args); end
798
731
 
799
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
732
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
800
733
  def distinct(*args); end
801
734
 
802
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
735
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
803
736
  def references(*args); end
804
737
 
805
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
738
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
806
739
  def none(*args); end
807
740
 
808
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
741
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
809
742
  def unscope(*args); end
810
743
 
811
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
744
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
812
745
  def merge(*args); end
813
746
 
814
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
747
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
815
748
  def except(*args); end
816
749
 
817
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_AssociationRelation) }
750
+ sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
818
751
  def extending(*args, &block); end
819
- end
820
-
821
- class Squib::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
822
- include Squib::CustomFinderMethods
823
- extend T::Sig
824
- extend T::Generic
825
- Elem = type_member(fixed: Squib)
826
-
827
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
828
- def Gryffindor(*args); end
829
-
830
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
831
- def Hagrid(*args); end
832
-
833
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
834
- def Hufflepuff(*args); end
835
-
836
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
837
- def Ravenclaw(*args); end
838
-
839
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
840
- def Slytherin(*args); end
841
-
842
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
843
- def black_hair(*args); end
844
-
845
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
846
- def blonde_hair(*args); end
847
-
848
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
849
- def broom_firebolt(*args); end
850
-
851
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
852
- def broom_nimbus(*args); end
853
-
854
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
855
- def brown_hair(*args); end
856
752
 
857
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
858
- def color_blue_eyes(*args); end
859
-
860
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
861
- def color_brown_eyes(*args); end
862
-
863
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
864
- def color_green_eyes(*args); end
865
-
866
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
867
- def quidditch_beater(*args); end
868
-
869
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
870
- def quidditch_chaser(*args); end
871
-
872
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
873
- def quidditch_keeper(*args); end
874
-
875
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
876
- def quidditch_seeker(*args); end
877
-
878
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
879
- def recent(*args); end
880
-
881
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
882
- def with_attached_hats(*args); end
883
-
884
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
885
- def with_attached_school_photo(*args); end
753
+ sig do
754
+ params(
755
+ of: T.nilable(Integer),
756
+ start: T.nilable(Integer),
757
+ finish: T.nilable(Integer),
758
+ load: T.nilable(T::Boolean),
759
+ error_on_ignore: T.nilable(T::Boolean),
760
+ block: T.nilable(T.proc.params(e: Squib::ActiveRecord_Relation).void)
761
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
762
+ end
763
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
764
+ end
886
765
 
766
+ module Squib::QueryMethodsReturningAssociationRelation
887
767
  sig { returns(Squib::ActiveRecord_AssociationRelation) }
888
768
  def all; end
889
769
 
890
- sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_AssociationRelation) }
770
+ sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
891
771
  def unscoped(&block); end
892
772
 
893
773
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
@@ -971,15 +851,15 @@ class Squib::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associati
971
851
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_AssociationRelation) }
972
852
  def extending(*args, &block); end
973
853
 
974
- sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
975
- def <<(*records); end
976
-
977
- sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
978
- def append(*records); end
979
-
980
- sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
981
- def push(*records); end
982
-
983
- sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
984
- def concat(*records); end
854
+ sig do
855
+ params(
856
+ of: T.nilable(Integer),
857
+ start: T.nilable(Integer),
858
+ finish: T.nilable(Integer),
859
+ load: T.nilable(T::Boolean),
860
+ error_on_ignore: T.nilable(T::Boolean),
861
+ block: T.nilable(T.proc.params(e: Squib::ActiveRecord_AssociationRelation).void)
862
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
863
+ end
864
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
985
865
  end