sorbet-rails 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sorbet-rails/active_record_rbi_formatter.rb +295 -0
  3. data/lib/sorbet-rails/config.rb +0 -1
  4. data/lib/sorbet-rails/custom_types/boolean_string.rb +10 -0
  5. data/lib/sorbet-rails/custom_types/integer_string.rb +10 -0
  6. data/lib/sorbet-rails/dependent_gem_rbis/activerecord.rbi +11 -0
  7. data/lib/sorbet-rails/deprecation.rb +5 -0
  8. data/lib/sorbet-rails/model_plugins/active_record_assoc.rb +27 -6
  9. data/lib/sorbet-rails/model_plugins/active_record_attribute.rb +20 -8
  10. data/lib/sorbet-rails/model_plugins/base.rb +9 -0
  11. data/lib/sorbet-rails/model_plugins/enumerable_collections.rb +0 -50
  12. data/lib/sorbet-rails/model_plugins/plugins.rb +0 -3
  13. data/lib/sorbet-rails/model_rbi_formatter.rb +2 -2
  14. data/lib/sorbet-rails/model_utils.rb +15 -6
  15. data/lib/sorbet-rails/rails_mixins/custom_params_methods.rb +11 -0
  16. data/lib/sorbet-rails/tasks/rails_rbi.rake +20 -4
  17. data/sorbet-rails.gemspec +2 -2
  18. data/spec/active_record_rbi_formatter_spec.rb +24 -0
  19. data/spec/generators/rails-template.rb +88 -1
  20. data/spec/generators/sorbet_test_cases.rb +146 -42
  21. data/spec/model_rbi_formatter_spec.rb +1 -1
  22. data/spec/rails_helper.rb +14 -1
  23. data/spec/rake_rails_rbi_active_record_spec.rb +21 -0
  24. data/spec/rake_rails_rbi_models_spec.rb +7 -0
  25. data/spec/sorbet_spec.rb +12 -1
  26. data/spec/support/v5.0/Gemfile.lock +8 -8
  27. data/spec/support/v5.0/app/models/headmaster.rb +8 -0
  28. data/spec/support/v5.0/app/models/school.rb +2 -0
  29. data/spec/support/v5.0/app/models/spell.rb +5 -0
  30. data/spec/support/v5.0/app/models/spell_book.rb +3 -0
  31. data/spec/support/v5.0/app/models/subject.rb +5 -0
  32. data/spec/support/v5.0/app/models/wizard.rb +6 -1
  33. data/spec/support/v5.0/db/migrate/20190620000010_add_subject.rb +8 -0
  34. data/spec/support/v5.0/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
  35. data/spec/support/v5.0/db/migrate/20190620000012_add_spell.rb +8 -0
  36. data/spec/support/v5.0/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
  37. data/spec/support/v5.0/db/migrate/20190620000014_create_headmasters.rb +9 -0
  38. data/spec/support/v5.0/db/schema.rb +28 -1
  39. data/spec/support/v5.0/lib/mythical_rbi_plugin.rb +1 -1
  40. data/spec/support/v5.0/sorbet_test_cases.rb +146 -42
  41. data/spec/support/v5.1/Gemfile.lock +8 -8
  42. data/spec/support/v5.1/app/models/headmaster.rb +8 -0
  43. data/spec/support/v5.1/app/models/school.rb +2 -0
  44. data/spec/support/v5.1/app/models/spell.rb +5 -0
  45. data/spec/support/v5.1/app/models/spell_book.rb +3 -0
  46. data/spec/support/v5.1/app/models/subject.rb +5 -0
  47. data/spec/support/v5.1/app/models/wizard.rb +6 -1
  48. data/spec/support/v5.1/db/migrate/20190620000010_add_subject.rb +8 -0
  49. data/spec/support/v5.1/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
  50. data/spec/support/v5.1/db/migrate/20190620000012_add_spell.rb +8 -0
  51. data/spec/support/v5.1/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
  52. data/spec/support/v5.1/db/migrate/20190620000014_create_headmasters.rb +9 -0
  53. data/spec/support/v5.1/db/schema.rb +28 -1
  54. data/spec/support/v5.1/lib/mythical_rbi_plugin.rb +1 -1
  55. data/spec/support/v5.1/sorbet_test_cases.rb +146 -42
  56. data/spec/support/v5.2/Gemfile +1 -1
  57. data/spec/support/v5.2/Gemfile.lock +9 -9
  58. data/spec/support/v5.2/app/models/headmaster.rb +8 -0
  59. data/spec/support/v5.2/app/models/school.rb +2 -0
  60. data/spec/support/v5.2/app/models/spell.rb +5 -0
  61. data/spec/support/v5.2/app/models/spell_book.rb +3 -0
  62. data/spec/support/v5.2/app/models/subject.rb +5 -0
  63. data/spec/support/v5.2/app/models/wizard.rb +5 -0
  64. data/spec/support/v5.2/config/puma.rb +3 -0
  65. data/spec/support/v5.2/db/migrate/20190620000010_add_subject.rb +8 -0
  66. data/spec/support/v5.2/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
  67. data/spec/support/v5.2/db/migrate/20190620000012_add_spell.rb +8 -0
  68. data/spec/support/v5.2/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
  69. data/spec/support/v5.2/db/migrate/20190620000014_create_headmasters.rb +9 -0
  70. data/spec/support/v5.2/db/schema.rb +28 -1
  71. data/spec/support/v5.2/lib/mythical_rbi_plugin.rb +1 -1
  72. data/spec/support/v5.2/sorbet_test_cases.rb +146 -42
  73. data/spec/support/v6.0/Gemfile.lock +8 -8
  74. data/spec/support/v6.0/app/models/headmaster.rb +8 -0
  75. data/spec/support/v6.0/app/models/school.rb +2 -0
  76. data/spec/support/v6.0/app/models/spell.rb +5 -0
  77. data/spec/support/v6.0/app/models/spell_book.rb +3 -0
  78. data/spec/support/v6.0/app/models/subject.rb +5 -0
  79. data/spec/support/v6.0/app/models/wizard.rb +6 -1
  80. data/spec/support/v6.0/db/migrate/20190620000010_add_subject.rb +8 -0
  81. data/spec/support/v6.0/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
  82. data/spec/support/v6.0/db/migrate/20190620000012_add_spell.rb +8 -0
  83. data/spec/support/v6.0/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
  84. data/spec/support/v6.0/db/migrate/20190620000014_create_headmasters.rb +9 -0
  85. data/spec/support/v6.0/db/schema.rb +28 -1
  86. data/spec/support/v6.0/lib/mythical_rbi_plugin.rb +1 -1
  87. data/spec/support/v6.0/sorbet_test_cases.rb +146 -42
  88. data/spec/test_data/v5.0/expected_active_record_base.rbi +113 -0
  89. data/spec/test_data/v5.0/expected_active_record_relation.rbi +199 -0
  90. data/spec/test_data/v5.0/expected_habtm_subjects.rbi +660 -0
  91. data/spec/test_data/v5.0/expected_habtm_wizards.rbi +660 -0
  92. data/spec/test_data/v5.0/expected_headmaster.rbi +452 -0
  93. data/spec/test_data/v5.0/expected_internal_metadata.rbi +0 -217
  94. data/spec/test_data/v5.0/expected_potion.rbi +0 -217
  95. data/spec/test_data/v5.0/expected_robe.rbi +0 -217
  96. data/spec/test_data/v5.0/expected_schema_migration.rbi +0 -217
  97. data/spec/test_data/v5.0/expected_school.rbi +11 -217
  98. data/spec/test_data/v5.0/expected_spell.rbi +440 -0
  99. data/spec/test_data/v5.0/expected_spell/habtm_spell_books.rbi +443 -0
  100. data/spec/test_data/v5.0/expected_spell_book.rbi +14 -222
  101. data/spec/test_data/v5.0/expected_spell_book/habtm_spell_books.rbi +637 -0
  102. data/spec/test_data/v5.0/expected_spell_book/habtm_spells.rbi +443 -0
  103. data/spec/test_data/v5.0/expected_squib.rbi +14 -219
  104. data/spec/test_data/v5.0/expected_subject.rbi +440 -0
  105. data/spec/test_data/v5.0/expected_subject/habtm_wizards.rbi +443 -0
  106. data/spec/test_data/v5.0/expected_wand.rbi +4 -221
  107. data/spec/test_data/v5.0/expected_wizard.rbi +36 -240
  108. data/spec/test_data/v5.0/expected_wizard/habtm_subjects.rbi +443 -0
  109. data/spec/test_data/v5.0/expected_wizard_wo_spellbook.rbi +30 -240
  110. data/spec/test_data/v5.1/expected_active_record_base.rbi +113 -0
  111. data/spec/test_data/v5.1/expected_active_record_relation.rbi +178 -0
  112. data/spec/test_data/v5.1/expected_habtm_subjects.rbi +672 -0
  113. data/spec/test_data/v5.1/expected_habtm_wizards.rbi +672 -0
  114. data/spec/test_data/v5.1/expected_headmaster.rbi +464 -0
  115. data/spec/test_data/v5.1/expected_internal_metadata.rbi +0 -217
  116. data/spec/test_data/v5.1/expected_potion.rbi +0 -217
  117. data/spec/test_data/v5.1/expected_robe.rbi +0 -217
  118. data/spec/test_data/v5.1/expected_schema_migration.rbi +0 -217
  119. data/spec/test_data/v5.1/expected_school.rbi +11 -217
  120. data/spec/test_data/v5.1/expected_spell.rbi +452 -0
  121. data/spec/test_data/v5.1/expected_spell/habtm_spell_books.rbi +455 -0
  122. data/spec/test_data/v5.1/expected_spell_book.rbi +14 -222
  123. data/spec/test_data/v5.1/expected_spell_book/habtm_spell_books.rbi +649 -0
  124. data/spec/test_data/v5.1/expected_spell_book/habtm_spells.rbi +455 -0
  125. data/spec/test_data/v5.1/expected_squib.rbi +14 -219
  126. data/spec/test_data/v5.1/expected_subject.rbi +452 -0
  127. data/spec/test_data/v5.1/expected_subject/habtm_wizards.rbi +455 -0
  128. data/spec/test_data/v5.1/expected_wand.rbi +4 -221
  129. data/spec/test_data/v5.1/expected_wizard.rbi +36 -240
  130. data/spec/test_data/v5.1/expected_wizard/habtm_subjects.rbi +455 -0
  131. data/spec/test_data/v5.1/expected_wizard_wo_spellbook.rbi +30 -240
  132. data/spec/test_data/v5.2/expected_active_record_base.rbi +113 -0
  133. data/spec/test_data/v5.2/expected_active_record_relation.rbi +175 -0
  134. data/spec/test_data/v5.2/expected_attachment.rbi +0 -217
  135. data/spec/test_data/v5.2/expected_blob.rbi +3 -217
  136. data/spec/test_data/v5.2/expected_habtm_subjects.rbi +672 -0
  137. data/spec/test_data/v5.2/expected_habtm_wizards.rbi +672 -0
  138. data/spec/test_data/v5.2/expected_headmaster.rbi +464 -0
  139. data/spec/test_data/v5.2/expected_internal_metadata.rbi +0 -217
  140. data/spec/test_data/v5.2/expected_potion.rbi +0 -217
  141. data/spec/test_data/v5.2/expected_robe.rbi +0 -217
  142. data/spec/test_data/v5.2/expected_schema_migration.rbi +0 -217
  143. data/spec/test_data/v5.2/expected_school.rbi +11 -217
  144. data/spec/test_data/v5.2/expected_spell.rbi +452 -0
  145. data/spec/test_data/v5.2/expected_spell/habtm_spell_books.rbi +455 -0
  146. data/spec/test_data/v5.2/expected_spell_book.rbi +14 -222
  147. data/spec/test_data/v5.2/expected_spell_book/habtm_spell_books.rbi +649 -0
  148. data/spec/test_data/v5.2/expected_spell_book/habtm_spells.rbi +455 -0
  149. data/spec/test_data/v5.2/expected_squib.rbi +20 -219
  150. data/spec/test_data/v5.2/expected_subject.rbi +452 -0
  151. data/spec/test_data/v5.2/expected_subject/habtm_wizards.rbi +455 -0
  152. data/spec/test_data/v5.2/expected_wand.rbi +4 -221
  153. data/spec/test_data/v5.2/expected_wizard.rbi +42 -240
  154. data/spec/test_data/v5.2/expected_wizard/habtm_subjects.rbi +455 -0
  155. data/spec/test_data/v5.2/expected_wizard_wo_spellbook.rbi +36 -240
  156. data/spec/test_data/v6.0/expected_active_record_base.rbi +113 -0
  157. data/spec/test_data/v6.0/expected_active_record_relation.rbi +175 -0
  158. data/spec/test_data/v6.0/expected_attachment.rbi +0 -217
  159. data/spec/test_data/v6.0/expected_blob.rbi +3 -217
  160. data/spec/test_data/v6.0/expected_habtm_subjects.rbi +720 -0
  161. data/spec/test_data/v6.0/expected_habtm_wizards.rbi +720 -0
  162. data/spec/test_data/v6.0/expected_headmaster.rbi +512 -0
  163. data/spec/test_data/v6.0/expected_internal_metadata.rbi +0 -217
  164. data/spec/test_data/v6.0/expected_potion.rbi +0 -217
  165. data/spec/test_data/v6.0/expected_robe.rbi +0 -217
  166. data/spec/test_data/v6.0/expected_schema_migration.rbi +0 -217
  167. data/spec/test_data/v6.0/expected_school.rbi +11 -217
  168. data/spec/test_data/v6.0/expected_spell.rbi +500 -0
  169. data/spec/test_data/v6.0/expected_spell/habtm_spell_books.rbi +503 -0
  170. data/spec/test_data/v6.0/expected_spell_book.rbi +14 -222
  171. data/spec/test_data/v6.0/expected_spell_book/habtm_spell_books.rbi +697 -0
  172. data/spec/test_data/v6.0/expected_spell_book/habtm_spells.rbi +503 -0
  173. data/spec/test_data/v6.0/expected_squib.rbi +20 -219
  174. data/spec/test_data/v6.0/expected_subject.rbi +500 -0
  175. data/spec/test_data/v6.0/expected_subject/habtm_wizards.rbi +503 -0
  176. data/spec/test_data/v6.0/expected_wand.rbi +4 -221
  177. data/spec/test_data/v6.0/expected_wizard.rbi +42 -240
  178. data/spec/test_data/v6.0/expected_wizard/habtm_subjects.rbi +503 -0
  179. data/spec/test_data/v6.0/expected_wizard_wo_spellbook.rbi +36 -240
  180. metadata +169 -14
  181. data/lib/bundled_rbi/active_record_base.rbi +0 -83
  182. data/lib/bundled_rbi/active_record_relation.rbi +0 -122
  183. data/lib/sorbet-rails/model_plugins/active_record_finder_methods.rb +0 -131
  184. data/spec/support/v5.0/typed-override.yaml +0 -2
  185. data/spec/support/v5.1/typed-override.yaml +0 -2
  186. data/spec/support/v5.2/typed-override.yaml +0 -2
  187. data/spec/support/v6.0/typed-override.yaml +0 -2
@@ -179,10 +179,10 @@ module Squib::GeneratedAttributeMethods
179
179
  sig { returns(T::Boolean) }
180
180
  def id?; end
181
181
 
182
- sig { returns(T.nilable(String)) }
182
+ sig { returns(String) }
183
183
  def name; end
184
184
 
185
- sig { params(value: T.nilable(T.any(String, Symbol))).void }
185
+ sig { params(value: T.any(String, Symbol)).void }
186
186
  def name=(value); end
187
187
 
188
188
  sig { returns(T::Boolean) }
@@ -258,12 +258,18 @@ module Squib::GeneratedAssociationMethods
258
258
  sig { returns(::ActiveStorage::Attachment::ActiveRecord_Associations_CollectionProxy) }
259
259
  def hats_attachments; end
260
260
 
261
+ sig { returns(T::Array[Integer]) }
262
+ def hats_attachment_ids; end
263
+
261
264
  sig { params(value: T::Enumerable[::ActiveStorage::Attachment]).void }
262
265
  def hats_attachments=(value); end
263
266
 
264
267
  sig { returns(::ActiveStorage::Blob::ActiveRecord_Associations_CollectionProxy) }
265
268
  def hats_blobs; end
266
269
 
270
+ sig { returns(T::Array[Integer]) }
271
+ def hats_blob_ids; end
272
+
267
273
  sig { params(value: T::Enumerable[::ActiveStorage::Blob]).void }
268
274
  def hats_blobs=(value); end
269
275
 
@@ -288,9 +294,21 @@ module Squib::GeneratedAssociationMethods
288
294
  sig { returns(::SpellBook::ActiveRecord_Associations_CollectionProxy) }
289
295
  def spell_books; end
290
296
 
297
+ sig { returns(T::Array[Integer]) }
298
+ def spell_book_ids; end
299
+
291
300
  sig { params(value: T::Enumerable[::SpellBook]).void }
292
301
  def spell_books=(value); end
293
302
 
303
+ sig { returns(::Subject::ActiveRecord_Associations_CollectionProxy) }
304
+ def subjects; end
305
+
306
+ sig { returns(T::Array[Integer]) }
307
+ def subject_ids; end
308
+
309
+ sig { params(value: T::Enumerable[::Subject]).void }
310
+ def subjects=(value); end
311
+
294
312
  sig { returns(T.nilable(::Wand)) }
295
313
  def wand; end
296
314
 
@@ -488,30 +506,11 @@ class Squib < Wizard
488
506
 
489
507
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
490
508
  def self.extending(*args, &block); end
491
-
492
- sig { params(conditions: T.untyped).returns(T::Boolean) }
493
- def self.exists?(conditions = nil); end
494
-
495
- sig { params(args: T.untyped).returns(T::Boolean) }
496
- def self.any?(*args); end
497
-
498
- sig { params(args: T.untyped).returns(T::Boolean) }
499
- def self.many?(*args); end
500
-
501
- sig { params(args: T.untyped).returns(T::Boolean) }
502
- def self.none?(*args); end
503
-
504
- sig { params(args: T.untyped).returns(T::Boolean) }
505
- def self.one?(*args); end
506
-
507
- sig { params(args: T.untyped).returns(T::Boolean) }
508
- def self.empty?(*args); end
509
509
  end
510
510
 
511
511
  class Squib::ActiveRecord_Relation < ActiveRecord::Relation
512
512
  include Squib::ActiveRelation_WhereNot
513
513
  include Squib::CustomFinderMethods
514
- include Enumerable
515
514
  extend T::Sig
516
515
  extend T::Generic
517
516
  Elem = type_member(fixed: Squib)
@@ -662,30 +661,11 @@ class Squib::ActiveRecord_Relation < ActiveRecord::Relation
662
661
 
663
662
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
664
663
  def extending(*args, &block); end
665
-
666
- sig { params(conditions: T.untyped).returns(T::Boolean) }
667
- def exists?(conditions = nil); end
668
-
669
- sig { params(args: T.untyped).returns(T::Boolean) }
670
- def any?(*args); end
671
-
672
- sig { params(args: T.untyped).returns(T::Boolean) }
673
- def many?(*args); end
674
-
675
- sig { params(args: T.untyped).returns(T::Boolean) }
676
- def none?(*args); end
677
-
678
- sig { params(args: T.untyped).returns(T::Boolean) }
679
- def one?(*args); end
680
-
681
- sig { params(args: T.untyped).returns(T::Boolean) }
682
- def empty?(*args); end
683
664
  end
684
665
 
685
666
  class Squib::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
686
667
  include Squib::ActiveRelation_WhereNot
687
668
  include Squib::CustomFinderMethods
688
- include Enumerable
689
669
  extend T::Sig
690
670
  extend T::Generic
691
671
  Elem = type_member(fixed: Squib)
@@ -836,100 +816,10 @@ class Squib::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelatio
836
816
 
837
817
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_AssociationRelation) }
838
818
  def extending(*args, &block); end
839
-
840
- sig { params(args: T.untyped).returns(Squib) }
841
- def find(*args); end
842
-
843
- sig { params(args: T.untyped).returns(T.nilable(Squib)) }
844
- def find_by(*args); end
845
-
846
- sig { params(args: T.untyped).returns(Squib) }
847
- def find_by!(*args); end
848
-
849
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
850
- def find_or_initialize_by(attributes, &block); end
851
-
852
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
853
- def find_or_create_by(attributes, &block); end
854
-
855
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
856
- def find_or_create_by!(attributes, &block); end
857
-
858
- sig { returns(T.nilable(Squib)) }
859
- def first; end
860
-
861
- sig { returns(Squib) }
862
- def first!; end
863
-
864
- sig { returns(T.nilable(Squib)) }
865
- def second; end
866
-
867
- sig { returns(Squib) }
868
- def second!; end
869
-
870
- sig { returns(T.nilable(Squib)) }
871
- def third; end
872
-
873
- sig { returns(Squib) }
874
- def third!; end
875
-
876
- sig { returns(T.nilable(Squib)) }
877
- def third_to_last; end
878
-
879
- sig { returns(Squib) }
880
- def third_to_last!; end
881
-
882
- sig { returns(T.nilable(Squib)) }
883
- def second_to_last; end
884
-
885
- sig { returns(Squib) }
886
- def second_to_last!; end
887
-
888
- sig { returns(T.nilable(Squib)) }
889
- def last; end
890
-
891
- sig { returns(Squib) }
892
- def last!; end
893
-
894
- sig { params(conditions: T.untyped).returns(T::Boolean) }
895
- def exists?(conditions = nil); end
896
-
897
- sig { params(args: T.untyped).returns(T::Boolean) }
898
- def any?(*args); end
899
-
900
- sig { params(args: T.untyped).returns(T::Boolean) }
901
- def many?(*args); end
902
-
903
- sig { params(args: T.untyped).returns(T::Boolean) }
904
- def none?(*args); end
905
-
906
- sig { params(args: T.untyped).returns(T::Boolean) }
907
- def one?(*args); end
908
-
909
- sig { params(args: T.untyped).returns(T::Boolean) }
910
- def empty?(*args); end
911
-
912
- sig { override.params(block: T.proc.params(e: Squib).void).returns(T::Array[Squib]) }
913
- def each(&block); end
914
-
915
- sig { params(level: T.nilable(Integer)).returns(T::Array[Squib]) }
916
- def flatten(level); end
917
-
918
- sig { returns(T::Array[Squib]) }
919
- def to_a; end
920
-
921
- sig do
922
- type_parameters(:U).params(
923
- blk: T.proc.params(arg0: Elem).returns(T.type_parameter(:U)),
924
- )
925
- .returns(T::Array[T.type_parameter(:U)])
926
- end
927
- def map(&blk); end
928
819
  end
929
820
 
930
821
  class Squib::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
931
822
  include Squib::CustomFinderMethods
932
- include Enumerable
933
823
  extend T::Sig
934
824
  extend T::Generic
935
825
  Elem = type_member(fixed: Squib)
@@ -1081,95 +971,6 @@ class Squib::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associati
1081
971
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_AssociationRelation) }
1082
972
  def extending(*args, &block); end
1083
973
 
1084
- sig { params(args: T.untyped).returns(Squib) }
1085
- def find(*args); end
1086
-
1087
- sig { params(args: T.untyped).returns(T.nilable(Squib)) }
1088
- def find_by(*args); end
1089
-
1090
- sig { params(args: T.untyped).returns(Squib) }
1091
- def find_by!(*args); end
1092
-
1093
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
1094
- def find_or_initialize_by(attributes, &block); end
1095
-
1096
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
1097
- def find_or_create_by(attributes, &block); end
1098
-
1099
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
1100
- def find_or_create_by!(attributes, &block); end
1101
-
1102
- sig { returns(T.nilable(Squib)) }
1103
- def first; end
1104
-
1105
- sig { returns(Squib) }
1106
- def first!; end
1107
-
1108
- sig { returns(T.nilable(Squib)) }
1109
- def second; end
1110
-
1111
- sig { returns(Squib) }
1112
- def second!; end
1113
-
1114
- sig { returns(T.nilable(Squib)) }
1115
- def third; end
1116
-
1117
- sig { returns(Squib) }
1118
- def third!; end
1119
-
1120
- sig { returns(T.nilable(Squib)) }
1121
- def third_to_last; end
1122
-
1123
- sig { returns(Squib) }
1124
- def third_to_last!; end
1125
-
1126
- sig { returns(T.nilable(Squib)) }
1127
- def second_to_last; end
1128
-
1129
- sig { returns(Squib) }
1130
- def second_to_last!; end
1131
-
1132
- sig { returns(T.nilable(Squib)) }
1133
- def last; end
1134
-
1135
- sig { returns(Squib) }
1136
- def last!; end
1137
-
1138
- sig { params(conditions: T.untyped).returns(T::Boolean) }
1139
- def exists?(conditions = nil); end
1140
-
1141
- sig { params(args: T.untyped).returns(T::Boolean) }
1142
- def any?(*args); end
1143
-
1144
- sig { params(args: T.untyped).returns(T::Boolean) }
1145
- def many?(*args); end
1146
-
1147
- sig { params(args: T.untyped).returns(T::Boolean) }
1148
- def none?(*args); end
1149
-
1150
- sig { params(args: T.untyped).returns(T::Boolean) }
1151
- def one?(*args); end
1152
-
1153
- sig { params(args: T.untyped).returns(T::Boolean) }
1154
- def empty?(*args); end
1155
-
1156
- sig { override.params(block: T.proc.params(e: Squib).void).returns(T::Array[Squib]) }
1157
- def each(&block); end
1158
-
1159
- sig { params(level: T.nilable(Integer)).returns(T::Array[Squib]) }
1160
- def flatten(level); end
1161
-
1162
- sig { returns(T::Array[Squib]) }
1163
- def to_a; end
1164
-
1165
- sig do
1166
- type_parameters(:U).params(
1167
- blk: T.proc.params(arg0: Elem).returns(T.type_parameter(:U)),
1168
- )
1169
- .returns(T::Array[T.type_parameter(:U)])
1170
- end
1171
- def map(&blk); end
1172
-
1173
974
  sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
1174
975
  def <<(*records); end
1175
976
 
@@ -0,0 +1,452 @@
1
+ # This is an autogenerated file for dynamic methods in Subject
2
+ # Please rerun bundle exec rake rails_rbi:models[Subject] to regenerate.
3
+
4
+ # typed: strong
5
+ module Subject::ActiveRelation_WhereNot
6
+ sig { params(opts: T.untyped, rest: T.untyped).returns(T.self_type) }
7
+ def not(opts, *rest); end
8
+ end
9
+
10
+ module Subject::GeneratedAttributeMethods
11
+ extend T::Sig
12
+
13
+ sig { returns(Integer) }
14
+ def id; end
15
+
16
+ sig { params(value: T.any(Numeric, ActiveSupport::Duration)).void }
17
+ def id=(value); end
18
+
19
+ sig { returns(T::Boolean) }
20
+ def id?; end
21
+
22
+ sig { returns(T.nilable(String)) }
23
+ def name; end
24
+
25
+ sig { params(value: T.nilable(T.any(String, Symbol))).void }
26
+ def name=(value); end
27
+
28
+ sig { returns(T::Boolean) }
29
+ def name?; end
30
+ end
31
+
32
+ module Subject::GeneratedAssociationMethods
33
+ extend T::Sig
34
+
35
+ sig { returns(::Wizard::ActiveRecord_Associations_CollectionProxy) }
36
+ def wizards; end
37
+
38
+ sig { returns(T::Array[Integer]) }
39
+ def wizard_ids; end
40
+
41
+ sig { params(value: T::Enumerable[::Wizard]).void }
42
+ def wizards=(value); end
43
+ end
44
+
45
+ module Subject::CustomFinderMethods
46
+ sig { params(limit: Integer).returns(T::Array[Subject]) }
47
+ def first_n(limit); end
48
+
49
+ sig { params(limit: Integer).returns(T::Array[Subject]) }
50
+ def last_n(limit); end
51
+
52
+ sig { params(args: T::Array[T.any(Integer, String)]).returns(T::Array[Subject]) }
53
+ def find_n(*args); end
54
+
55
+ sig { params(id: Integer).returns(T.nilable(Subject)) }
56
+ def find_by_id(id); end
57
+
58
+ sig { params(id: Integer).returns(Subject) }
59
+ def find_by_id!(id); end
60
+ end
61
+
62
+ class Subject < ApplicationRecord
63
+ include Subject::GeneratedAttributeMethods
64
+ include Subject::GeneratedAssociationMethods
65
+ extend Subject::CustomFinderMethods
66
+ extend T::Sig
67
+ extend T::Generic
68
+ RelationType = T.type_alias { T.any(Subject::ActiveRecord_Relation, Subject::ActiveRecord_Associations_CollectionProxy, Subject::ActiveRecord_AssociationRelation) }
69
+
70
+ sig { returns(Subject::ActiveRecord_Relation) }
71
+ def self.all; end
72
+
73
+ sig { params(block: T.nilable(T.proc.void)).returns(Subject::ActiveRecord_Relation) }
74
+ def self.unscoped(&block); end
75
+
76
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
77
+ def self.select(*args); end
78
+
79
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
80
+ def self.order(*args); end
81
+
82
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
83
+ def self.reorder(*args); end
84
+
85
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
86
+ def self.group(*args); end
87
+
88
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
89
+ def self.limit(*args); end
90
+
91
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
92
+ def self.offset(*args); end
93
+
94
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
95
+ def self.joins(*args); end
96
+
97
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
98
+ def self.left_joins(*args); end
99
+
100
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
101
+ def self.left_outer_joins(*args); end
102
+
103
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
104
+ def self.where(*args); end
105
+
106
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
107
+ def self.rewhere(*args); end
108
+
109
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
110
+ def self.preload(*args); end
111
+
112
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
113
+ def self.eager_load(*args); end
114
+
115
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
116
+ def self.includes(*args); end
117
+
118
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
119
+ def self.from(*args); end
120
+
121
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
122
+ def self.lock(*args); end
123
+
124
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
125
+ def self.readonly(*args); end
126
+
127
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
128
+ def self.or(*args); end
129
+
130
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
131
+ def self.having(*args); end
132
+
133
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
134
+ def self.create_with(*args); end
135
+
136
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
137
+ def self.distinct(*args); end
138
+
139
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
140
+ def self.references(*args); end
141
+
142
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
143
+ def self.none(*args); end
144
+
145
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
146
+ def self.unscope(*args); end
147
+
148
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
149
+ def self.merge(*args); end
150
+
151
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
152
+ def self.except(*args); end
153
+
154
+ sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Subject::ActiveRecord_Relation) }
155
+ def self.extending(*args, &block); end
156
+ end
157
+
158
+ class Subject::ActiveRecord_Relation < ActiveRecord::Relation
159
+ include Subject::ActiveRelation_WhereNot
160
+ include Subject::CustomFinderMethods
161
+ extend T::Sig
162
+ extend T::Generic
163
+ Elem = type_member(fixed: Subject)
164
+
165
+ sig { returns(Subject::ActiveRecord_Relation) }
166
+ def all; end
167
+
168
+ sig { params(block: T.nilable(T.proc.void)).returns(Subject::ActiveRecord_Relation) }
169
+ def unscoped(&block); end
170
+
171
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
172
+ def select(*args); end
173
+
174
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
175
+ def order(*args); end
176
+
177
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
178
+ def reorder(*args); end
179
+
180
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
181
+ def group(*args); end
182
+
183
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
184
+ def limit(*args); end
185
+
186
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
187
+ def offset(*args); end
188
+
189
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
190
+ def joins(*args); end
191
+
192
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
193
+ def left_joins(*args); end
194
+
195
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
196
+ def left_outer_joins(*args); end
197
+
198
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
199
+ def where(*args); end
200
+
201
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
202
+ def rewhere(*args); end
203
+
204
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
205
+ def preload(*args); end
206
+
207
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
208
+ def eager_load(*args); end
209
+
210
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
211
+ def includes(*args); end
212
+
213
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
214
+ def from(*args); end
215
+
216
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
217
+ def lock(*args); end
218
+
219
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
220
+ def readonly(*args); end
221
+
222
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
223
+ def or(*args); end
224
+
225
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
226
+ def having(*args); end
227
+
228
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
229
+ def create_with(*args); end
230
+
231
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
232
+ def distinct(*args); end
233
+
234
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
235
+ def references(*args); end
236
+
237
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
238
+ def none(*args); end
239
+
240
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
241
+ def unscope(*args); end
242
+
243
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
244
+ def merge(*args); end
245
+
246
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_Relation) }
247
+ def except(*args); end
248
+
249
+ sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Subject::ActiveRecord_Relation) }
250
+ def extending(*args, &block); end
251
+ end
252
+
253
+ class Subject::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
254
+ include Subject::ActiveRelation_WhereNot
255
+ include Subject::CustomFinderMethods
256
+ extend T::Sig
257
+ extend T::Generic
258
+ Elem = type_member(fixed: Subject)
259
+
260
+ sig { returns(Subject::ActiveRecord_AssociationRelation) }
261
+ def all; end
262
+
263
+ sig { params(block: T.nilable(T.proc.void)).returns(Subject::ActiveRecord_AssociationRelation) }
264
+ def unscoped(&block); end
265
+
266
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
267
+ def select(*args); end
268
+
269
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
270
+ def order(*args); end
271
+
272
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
273
+ def reorder(*args); end
274
+
275
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
276
+ def group(*args); end
277
+
278
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
279
+ def limit(*args); end
280
+
281
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
282
+ def offset(*args); end
283
+
284
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
285
+ def joins(*args); end
286
+
287
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
288
+ def left_joins(*args); end
289
+
290
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
291
+ def left_outer_joins(*args); end
292
+
293
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
294
+ def where(*args); end
295
+
296
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
297
+ def rewhere(*args); end
298
+
299
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
300
+ def preload(*args); end
301
+
302
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
303
+ def eager_load(*args); end
304
+
305
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
306
+ def includes(*args); end
307
+
308
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
309
+ def from(*args); end
310
+
311
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
312
+ def lock(*args); end
313
+
314
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
315
+ def readonly(*args); end
316
+
317
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
318
+ def or(*args); end
319
+
320
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
321
+ def having(*args); end
322
+
323
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
324
+ def create_with(*args); end
325
+
326
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
327
+ def distinct(*args); end
328
+
329
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
330
+ def references(*args); end
331
+
332
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
333
+ def none(*args); end
334
+
335
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
336
+ def unscope(*args); end
337
+
338
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
339
+ def merge(*args); end
340
+
341
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
342
+ def except(*args); end
343
+
344
+ sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Subject::ActiveRecord_AssociationRelation) }
345
+ def extending(*args, &block); end
346
+ end
347
+
348
+ class Subject::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
349
+ include Subject::CustomFinderMethods
350
+ extend T::Sig
351
+ extend T::Generic
352
+ Elem = type_member(fixed: Subject)
353
+
354
+ sig { returns(Subject::ActiveRecord_AssociationRelation) }
355
+ def all; end
356
+
357
+ sig { params(block: T.nilable(T.proc.void)).returns(Subject::ActiveRecord_AssociationRelation) }
358
+ def unscoped(&block); end
359
+
360
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
361
+ def select(*args); end
362
+
363
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
364
+ def order(*args); end
365
+
366
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
367
+ def reorder(*args); end
368
+
369
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
370
+ def group(*args); end
371
+
372
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
373
+ def limit(*args); end
374
+
375
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
376
+ def offset(*args); end
377
+
378
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
379
+ def joins(*args); end
380
+
381
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
382
+ def left_joins(*args); end
383
+
384
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
385
+ def left_outer_joins(*args); end
386
+
387
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
388
+ def where(*args); end
389
+
390
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
391
+ def rewhere(*args); end
392
+
393
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
394
+ def preload(*args); end
395
+
396
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
397
+ def eager_load(*args); end
398
+
399
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
400
+ def includes(*args); end
401
+
402
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
403
+ def from(*args); end
404
+
405
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
406
+ def lock(*args); end
407
+
408
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
409
+ def readonly(*args); end
410
+
411
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
412
+ def or(*args); end
413
+
414
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
415
+ def having(*args); end
416
+
417
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
418
+ def create_with(*args); end
419
+
420
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
421
+ def distinct(*args); end
422
+
423
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
424
+ def references(*args); end
425
+
426
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
427
+ def none(*args); end
428
+
429
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
430
+ def unscope(*args); end
431
+
432
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
433
+ def merge(*args); end
434
+
435
+ sig { params(args: T.untyped).returns(Subject::ActiveRecord_AssociationRelation) }
436
+ def except(*args); end
437
+
438
+ sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Subject::ActiveRecord_AssociationRelation) }
439
+ def extending(*args, &block); end
440
+
441
+ sig { params(records: T.any(Subject, T::Array[Subject])).returns(T.self_type) }
442
+ def <<(*records); end
443
+
444
+ sig { params(records: T.any(Subject, T::Array[Subject])).returns(T.self_type) }
445
+ def append(*records); end
446
+
447
+ sig { params(records: T.any(Subject, T::Array[Subject])).returns(T.self_type) }
448
+ def push(*records); end
449
+
450
+ sig { params(records: T.any(Subject, T::Array[Subject])).returns(T.self_type) }
451
+ def concat(*records); end
452
+ end