sorbet-rails 0.6.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -0
  3. data/README.md +3 -3
  4. data/lib/bundled_rbi/typed_enum.rbi +7 -0
  5. data/lib/sorbet-rails.rb +0 -2
  6. data/lib/sorbet-rails/active_record_rbi_formatter.rb +301 -0
  7. data/lib/sorbet-rails/config.rb +0 -1
  8. data/lib/sorbet-rails/dependent_gem_rbis/activerecord.rbi +11 -0
  9. data/lib/sorbet-rails/deprecation.rb +5 -0
  10. data/lib/sorbet-rails/gem_plugins/active_flag_plugin.rb +0 -1
  11. data/lib/sorbet-rails/gem_plugins/paperclip_plugin.rb +0 -1
  12. data/lib/sorbet-rails/model_plugins/active_record_assoc.rb +36 -8
  13. data/lib/sorbet-rails/model_plugins/active_record_attribute.rb +20 -9
  14. data/lib/sorbet-rails/model_plugins/active_record_enum.rb +0 -1
  15. data/lib/sorbet-rails/model_plugins/active_record_named_scope.rb +15 -6
  16. data/lib/sorbet-rails/model_plugins/active_record_querying.rb +34 -3
  17. data/lib/sorbet-rails/model_plugins/active_storage_methods.rb +1 -1
  18. data/lib/sorbet-rails/model_plugins/base.rb +10 -0
  19. data/lib/sorbet-rails/model_plugins/enumerable_collections.rb +0 -50
  20. data/lib/sorbet-rails/model_plugins/plugins.rb +0 -3
  21. data/lib/sorbet-rails/model_rbi_formatter.rb +6 -10
  22. data/lib/sorbet-rails/model_utils.rb +83 -36
  23. data/lib/sorbet-rails/rails_mixins/generated_url_helpers.rb +2 -3
  24. data/lib/sorbet-rails/railtie.rb +0 -2
  25. data/lib/sorbet-rails/tasks/rails_rbi.rake +32 -24
  26. data/sorbet-rails.gemspec +2 -2
  27. data/spec/active_record_rbi_formatter_spec.rb +24 -0
  28. data/spec/generators/rails-template.rb +90 -6
  29. data/spec/generators/sorbet_test_cases.rb +204 -122
  30. data/spec/model_rbi_formatter_spec.rb +1 -1
  31. data/spec/rails_helper.rb +14 -1
  32. data/spec/rake_rails_rbi_active_record_spec.rb +21 -0
  33. data/spec/rake_rails_rbi_models_spec.rb +7 -0
  34. data/spec/sorbet_spec.rb +12 -1
  35. data/spec/support/v5.0/Gemfile.lock +8 -8
  36. data/spec/support/v5.0/app/models/headmaster.rb +8 -0
  37. data/spec/support/v5.0/app/models/school.rb +2 -0
  38. data/spec/support/v5.0/app/models/spell.rb +5 -0
  39. data/spec/support/v5.0/app/models/spell_book.rb +5 -0
  40. data/spec/support/v5.0/app/models/subject.rb +5 -0
  41. data/spec/support/v5.0/app/models/wizard.rb +6 -1
  42. data/spec/support/v5.0/db/migrate/20190620000010_add_subject.rb +8 -0
  43. data/spec/support/v5.0/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
  44. data/spec/support/v5.0/db/migrate/20190620000012_add_spell.rb +8 -0
  45. data/spec/support/v5.0/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
  46. data/spec/support/v5.0/db/migrate/20190620000014_create_headmasters.rb +9 -0
  47. data/spec/support/v5.0/db/schema.rb +28 -1
  48. data/spec/support/v5.0/lib/mythical_rbi_plugin.rb +1 -1
  49. data/spec/support/v5.0/sorbet_test_cases.rb +204 -122
  50. data/spec/support/v5.1/Gemfile.lock +8 -8
  51. data/spec/support/v5.1/app/models/headmaster.rb +8 -0
  52. data/spec/support/v5.1/app/models/school.rb +2 -0
  53. data/spec/support/v5.1/app/models/spell.rb +5 -0
  54. data/spec/support/v5.1/app/models/spell_book.rb +5 -0
  55. data/spec/support/v5.1/app/models/subject.rb +5 -0
  56. data/spec/support/v5.1/app/models/wizard.rb +6 -1
  57. data/spec/support/v5.1/db/migrate/20190620000010_add_subject.rb +8 -0
  58. data/spec/support/v5.1/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
  59. data/spec/support/v5.1/db/migrate/20190620000012_add_spell.rb +8 -0
  60. data/spec/support/v5.1/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
  61. data/spec/support/v5.1/db/migrate/20190620000014_create_headmasters.rb +9 -0
  62. data/spec/support/v5.1/db/schema.rb +28 -1
  63. data/spec/support/v5.1/lib/mythical_rbi_plugin.rb +1 -1
  64. data/spec/support/v5.1/sorbet_test_cases.rb +204 -122
  65. data/spec/support/v5.2/Gemfile +1 -1
  66. data/spec/support/v5.2/Gemfile.lock +9 -9
  67. data/spec/support/v5.2/app/models/headmaster.rb +8 -0
  68. data/spec/support/v5.2/app/models/school.rb +2 -0
  69. data/spec/support/v5.2/app/models/spell.rb +5 -0
  70. data/spec/support/v5.2/app/models/spell_book.rb +5 -0
  71. data/spec/support/v5.2/app/models/subject.rb +5 -0
  72. data/spec/support/v5.2/app/models/wizard.rb +5 -0
  73. data/spec/support/v5.2/config/puma.rb +3 -0
  74. data/spec/support/v5.2/db/migrate/20190620000010_add_subject.rb +8 -0
  75. data/spec/support/v5.2/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
  76. data/spec/support/v5.2/db/migrate/20190620000012_add_spell.rb +8 -0
  77. data/spec/support/v5.2/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
  78. data/spec/support/v5.2/db/migrate/20190620000014_create_headmasters.rb +9 -0
  79. data/spec/support/v5.2/db/schema.rb +28 -1
  80. data/spec/support/v5.2/lib/mythical_rbi_plugin.rb +1 -1
  81. data/spec/support/v5.2/sorbet_test_cases.rb +204 -122
  82. data/spec/support/v6.0/Gemfile.lock +8 -8
  83. data/spec/support/v6.0/app/models/headmaster.rb +8 -0
  84. data/spec/support/v6.0/app/models/school.rb +2 -0
  85. data/spec/support/v6.0/app/models/spell.rb +5 -0
  86. data/spec/support/v6.0/app/models/spell_book.rb +5 -0
  87. data/spec/support/v6.0/app/models/subject.rb +5 -0
  88. data/spec/support/v6.0/app/models/wizard.rb +6 -1
  89. data/spec/support/v6.0/db/migrate/20190620000010_add_subject.rb +8 -0
  90. data/spec/support/v6.0/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
  91. data/spec/support/v6.0/db/migrate/20190620000012_add_spell.rb +8 -0
  92. data/spec/support/v6.0/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
  93. data/spec/support/v6.0/db/migrate/20190620000014_create_headmasters.rb +9 -0
  94. data/spec/support/v6.0/db/schema.rb +28 -1
  95. data/spec/support/v6.0/lib/mythical_rbi_plugin.rb +1 -1
  96. data/spec/support/v6.0/sorbet_test_cases.rb +204 -122
  97. data/spec/test_data/v5.0/expected_active_record_base.rbi +113 -0
  98. data/spec/test_data/v5.0/expected_active_record_relation.rbi +199 -0
  99. data/spec/test_data/v5.0/expected_habtm_subjects.rbi +660 -0
  100. data/spec/test_data/v5.0/expected_habtm_wizards.rbi +660 -0
  101. data/spec/test_data/v5.0/expected_headmaster.rbi +304 -0
  102. data/spec/test_data/v5.0/expected_internal_metadata.rbi +38 -401
  103. data/spec/test_data/v5.0/expected_potion.rbi +38 -401
  104. data/spec/test_data/v5.0/expected_robe.rbi +38 -403
  105. data/spec/test_data/v5.0/expected_schema_migration.rbi +38 -401
  106. data/spec/test_data/v5.0/expected_school.rbi +47 -401
  107. data/spec/test_data/v5.0/expected_spell.rbi +292 -0
  108. data/spec/test_data/v5.0/expected_spell/habtm_spell_books.rbi +295 -0
  109. data/spec/test_data/v5.0/expected_spell_book.rbi +86 -432
  110. data/spec/test_data/v5.0/expected_spell_book/habtm_spell_books.rbi +637 -0
  111. data/spec/test_data/v5.0/expected_spell_book/habtm_spells.rbi +295 -0
  112. data/spec/test_data/v5.0/expected_squib.rbi +122 -477
  113. data/spec/test_data/v5.0/expected_subject.rbi +292 -0
  114. data/spec/test_data/v5.0/expected_subject/habtm_wizards.rbi +295 -0
  115. data/spec/test_data/v5.0/expected_wand.rbi +75 -442
  116. data/spec/test_data/v5.0/expected_wizard.rbi +144 -498
  117. data/spec/test_data/v5.0/expected_wizard/habtm_subjects.rbi +295 -0
  118. data/spec/test_data/v5.0/expected_wizard_wo_spellbook.rbi +138 -498
  119. data/spec/test_data/v5.1/expected_active_record_base.rbi +113 -0
  120. data/spec/test_data/v5.1/expected_active_record_relation.rbi +178 -0
  121. data/spec/test_data/v5.1/expected_habtm_subjects.rbi +672 -0
  122. data/spec/test_data/v5.1/expected_habtm_wizards.rbi +672 -0
  123. data/spec/test_data/v5.1/expected_headmaster.rbi +310 -0
  124. data/spec/test_data/v5.1/expected_internal_metadata.rbi +38 -407
  125. data/spec/test_data/v5.1/expected_potion.rbi +38 -407
  126. data/spec/test_data/v5.1/expected_robe.rbi +38 -409
  127. data/spec/test_data/v5.1/expected_schema_migration.rbi +38 -407
  128. data/spec/test_data/v5.1/expected_school.rbi +47 -407
  129. data/spec/test_data/v5.1/expected_spell.rbi +298 -0
  130. data/spec/test_data/v5.1/expected_spell/habtm_spell_books.rbi +301 -0
  131. data/spec/test_data/v5.1/expected_spell_book.rbi +86 -438
  132. data/spec/test_data/v5.1/expected_spell_book/habtm_spell_books.rbi +649 -0
  133. data/spec/test_data/v5.1/expected_spell_book/habtm_spells.rbi +301 -0
  134. data/spec/test_data/v5.1/expected_squib.rbi +123 -484
  135. data/spec/test_data/v5.1/expected_subject.rbi +298 -0
  136. data/spec/test_data/v5.1/expected_subject/habtm_wizards.rbi +301 -0
  137. data/spec/test_data/v5.1/expected_wand.rbi +75 -448
  138. data/spec/test_data/v5.1/expected_wizard.rbi +145 -505
  139. data/spec/test_data/v5.1/expected_wizard/habtm_subjects.rbi +301 -0
  140. data/spec/test_data/v5.1/expected_wizard_wo_spellbook.rbi +139 -505
  141. data/spec/test_data/v5.2/expected_active_record_base.rbi +113 -0
  142. data/spec/test_data/v5.2/expected_active_record_relation.rbi +175 -0
  143. data/spec/test_data/v5.2/expected_attachment.rbi +38 -407
  144. data/spec/test_data/v5.2/expected_blob.rbi +60 -426
  145. data/spec/test_data/v5.2/expected_habtm_subjects.rbi +672 -0
  146. data/spec/test_data/v5.2/expected_habtm_wizards.rbi +672 -0
  147. data/spec/test_data/v5.2/expected_headmaster.rbi +310 -0
  148. data/spec/test_data/v5.2/expected_internal_metadata.rbi +38 -407
  149. data/spec/test_data/v5.2/expected_potion.rbi +38 -407
  150. data/spec/test_data/v5.2/expected_robe.rbi +38 -409
  151. data/spec/test_data/v5.2/expected_schema_migration.rbi +38 -407
  152. data/spec/test_data/v5.2/expected_school.rbi +47 -407
  153. data/spec/test_data/v5.2/expected_spell.rbi +298 -0
  154. data/spec/test_data/v5.2/expected_spell/habtm_spell_books.rbi +301 -0
  155. data/spec/test_data/v5.2/expected_spell_book.rbi +86 -438
  156. data/spec/test_data/v5.2/expected_spell_book/habtm_spell_books.rbi +649 -0
  157. data/spec/test_data/v5.2/expected_spell_book/habtm_spells.rbi +301 -0
  158. data/spec/test_data/v5.2/expected_squib.rbi +133 -488
  159. data/spec/test_data/v5.2/expected_subject.rbi +298 -0
  160. data/spec/test_data/v5.2/expected_subject/habtm_wizards.rbi +301 -0
  161. data/spec/test_data/v5.2/expected_wand.rbi +75 -448
  162. data/spec/test_data/v5.2/expected_wizard.rbi +155 -509
  163. data/spec/test_data/v5.2/expected_wizard/habtm_subjects.rbi +301 -0
  164. data/spec/test_data/v5.2/expected_wizard_wo_spellbook.rbi +149 -509
  165. data/spec/test_data/v6.0/expected_active_record_base.rbi +113 -0
  166. data/spec/test_data/v6.0/expected_active_record_relation.rbi +175 -0
  167. data/spec/test_data/v6.0/expected_attachment.rbi +38 -431
  168. data/spec/test_data/v6.0/expected_blob.rbi +60 -450
  169. data/spec/test_data/v6.0/expected_habtm_subjects.rbi +720 -0
  170. data/spec/test_data/v6.0/expected_habtm_wizards.rbi +720 -0
  171. data/spec/test_data/v6.0/expected_headmaster.rbi +334 -0
  172. data/spec/test_data/v6.0/expected_internal_metadata.rbi +38 -431
  173. data/spec/test_data/v6.0/expected_potion.rbi +38 -431
  174. data/spec/test_data/v6.0/expected_robe.rbi +38 -433
  175. data/spec/test_data/v6.0/expected_routes.rbi +14 -7
  176. data/spec/test_data/v6.0/expected_schema_migration.rbi +38 -431
  177. data/spec/test_data/v6.0/expected_school.rbi +47 -431
  178. data/spec/test_data/v6.0/expected_spell.rbi +322 -0
  179. data/spec/test_data/v6.0/expected_spell/habtm_spell_books.rbi +325 -0
  180. data/spec/test_data/v6.0/expected_spell_book.rbi +98 -474
  181. data/spec/test_data/v6.0/expected_spell_book/habtm_spell_books.rbi +697 -0
  182. data/spec/test_data/v6.0/expected_spell_book/habtm_spells.rbi +325 -0
  183. data/spec/test_data/v6.0/expected_squib.rbi +162 -541
  184. data/spec/test_data/v6.0/expected_subject.rbi +322 -0
  185. data/spec/test_data/v6.0/expected_subject/habtm_wizards.rbi +325 -0
  186. data/spec/test_data/v6.0/expected_wand.rbi +91 -488
  187. data/spec/test_data/v6.0/expected_wizard.rbi +184 -562
  188. data/spec/test_data/v6.0/expected_wizard/habtm_subjects.rbi +325 -0
  189. data/spec/test_data/v6.0/expected_wizard_wo_spellbook.rbi +178 -562
  190. metadata +170 -24
  191. data/lib/bundled_rbi/active_record_base.rbi +0 -83
  192. data/lib/bundled_rbi/active_record_relation.rbi +0 -122
  193. data/lib/bundled_rbi/parameters.rbi +0 -28
  194. data/lib/sorbet-rails/custom_types/boolean_string.rb +0 -32
  195. data/lib/sorbet-rails/custom_types/integer_string.rb +0 -35
  196. data/lib/sorbet-rails/model_plugins/active_record_finder_methods.rb +0 -131
  197. data/lib/sorbet-rails/rails_mixins/custom_params_methods.rb +0 -46
  198. data/spec/boolean_string_spec.rb +0 -59
  199. data/spec/custom_params_methods_spec.rb +0 -138
  200. data/spec/integer_string_spec.rb +0 -46
  201. data/spec/support/v5.0/typed-override.yaml +0 -2
  202. data/spec/support/v5.1/typed-override.yaml +0 -2
  203. data/spec/support/v5.2/typed-override.yaml +0 -2
  204. data/spec/support/v6.0/typed-override.yaml +0 -2
@@ -0,0 +1,301 @@
1
+ # This is an autogenerated file for dynamic methods in SpellBook::HABTM_Spells
2
+ # Please rerun bundle exec rake rails_rbi:models[SpellBook::HABTM_Spells] to regenerate.
3
+
4
+ # typed: strong
5
+ module SpellBook::HABTM_Spells::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 SpellBook::HABTM_Spells::GeneratedAttributeMethods
11
+ sig { returns(Integer) }
12
+ def spell_book_id; end
13
+
14
+ sig { params(value: T.any(Numeric, ActiveSupport::Duration)).void }
15
+ def spell_book_id=(value); end
16
+
17
+ sig { returns(T::Boolean) }
18
+ def spell_book_id?; end
19
+
20
+ sig { returns(Integer) }
21
+ def spell_id; end
22
+
23
+ sig { params(value: T.any(Numeric, ActiveSupport::Duration)).void }
24
+ def spell_id=(value); end
25
+
26
+ sig { returns(T::Boolean) }
27
+ def spell_id?; end
28
+ end
29
+
30
+ module SpellBook::HABTM_Spells::GeneratedAssociationMethods
31
+ sig { returns(T.nilable(::SpellBook)) }
32
+ def left_side; end
33
+
34
+ sig { params(value: T.nilable(::SpellBook)).void }
35
+ def left_side=(value); end
36
+
37
+ sig { returns(::Spell) }
38
+ def spell; end
39
+
40
+ sig { params(value: ::Spell).void }
41
+ def spell=(value); end
42
+ end
43
+
44
+ module SpellBook::HABTM_Spells::CustomFinderMethods
45
+ sig { params(limit: Integer).returns(T::Array[SpellBook::HABTM_Spells]) }
46
+ def first_n(limit); end
47
+
48
+ sig { params(limit: Integer).returns(T::Array[SpellBook::HABTM_Spells]) }
49
+ def last_n(limit); end
50
+
51
+ sig { params(args: T::Array[T.any(Integer, String)]).returns(T::Array[SpellBook::HABTM_Spells]) }
52
+ def find_n(*args); end
53
+
54
+ sig { params(id: Integer).returns(T.nilable(SpellBook::HABTM_Spells)) }
55
+ def find_by_id(id); end
56
+
57
+ sig { params(id: Integer).returns(SpellBook::HABTM_Spells) }
58
+ def find_by_id!(id); end
59
+ end
60
+
61
+ class SpellBook::HABTM_Spells < ActiveRecord::Base
62
+ include SpellBook::HABTM_Spells::GeneratedAttributeMethods
63
+ include SpellBook::HABTM_Spells::GeneratedAssociationMethods
64
+ extend SpellBook::HABTM_Spells::CustomFinderMethods
65
+ extend SpellBook::HABTM_Spells::QueryMethodsReturningRelation
66
+ RelationType = T.type_alias { T.any(SpellBook::HABTM_Spells::ActiveRecord_Relation, SpellBook::HABTM_Spells::ActiveRecord_Associations_CollectionProxy, SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
67
+ end
68
+
69
+ module SpellBook::HABTM_Spells::QueryMethodsReturningRelation
70
+ sig { returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
71
+ def all; end
72
+
73
+ sig { params(block: T.nilable(T.proc.void)).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
74
+ def unscoped(&block); end
75
+
76
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
77
+ def select(*args); end
78
+
79
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
80
+ def order(*args); end
81
+
82
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
83
+ def reorder(*args); end
84
+
85
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
86
+ def group(*args); end
87
+
88
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
89
+ def limit(*args); end
90
+
91
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
92
+ def offset(*args); end
93
+
94
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
95
+ def joins(*args); end
96
+
97
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
98
+ def left_joins(*args); end
99
+
100
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
101
+ def left_outer_joins(*args); end
102
+
103
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
104
+ def where(*args); end
105
+
106
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
107
+ def rewhere(*args); end
108
+
109
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
110
+ def preload(*args); end
111
+
112
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
113
+ def eager_load(*args); end
114
+
115
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
116
+ def includes(*args); end
117
+
118
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
119
+ def from(*args); end
120
+
121
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
122
+ def lock(*args); end
123
+
124
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
125
+ def readonly(*args); end
126
+
127
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
128
+ def or(*args); end
129
+
130
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
131
+ def having(*args); end
132
+
133
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
134
+ def create_with(*args); end
135
+
136
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
137
+ def distinct(*args); end
138
+
139
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
140
+ def references(*args); end
141
+
142
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
143
+ def none(*args); end
144
+
145
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
146
+ def unscope(*args); end
147
+
148
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
149
+ def merge(*args); end
150
+
151
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
152
+ def except(*args); end
153
+
154
+ sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
155
+ def extending(*args, &block); end
156
+
157
+ sig do
158
+ params(
159
+ of: T.nilable(Integer),
160
+ start: T.nilable(Integer),
161
+ finish: T.nilable(Integer),
162
+ load: T.nilable(T::Boolean),
163
+ error_on_ignore: T.nilable(T::Boolean),
164
+ block: T.nilable(T.proc.params(e: SpellBook::HABTM_Spells::ActiveRecord_Relation).void)
165
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
166
+ end
167
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
168
+ end
169
+
170
+ module SpellBook::HABTM_Spells::QueryMethodsReturningAssociationRelation
171
+ sig { returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
172
+ def all; end
173
+
174
+ sig { params(block: T.nilable(T.proc.void)).returns(SpellBook::HABTM_Spells::ActiveRecord_Relation) }
175
+ def unscoped(&block); end
176
+
177
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
178
+ def select(*args); end
179
+
180
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
181
+ def order(*args); end
182
+
183
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
184
+ def reorder(*args); end
185
+
186
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
187
+ def group(*args); end
188
+
189
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
190
+ def limit(*args); end
191
+
192
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
193
+ def offset(*args); end
194
+
195
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
196
+ def joins(*args); end
197
+
198
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
199
+ def left_joins(*args); end
200
+
201
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
202
+ def left_outer_joins(*args); end
203
+
204
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
205
+ def where(*args); end
206
+
207
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
208
+ def rewhere(*args); end
209
+
210
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
211
+ def preload(*args); end
212
+
213
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
214
+ def eager_load(*args); end
215
+
216
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
217
+ def includes(*args); end
218
+
219
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
220
+ def from(*args); end
221
+
222
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
223
+ def lock(*args); end
224
+
225
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
226
+ def readonly(*args); end
227
+
228
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
229
+ def or(*args); end
230
+
231
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
232
+ def having(*args); end
233
+
234
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
235
+ def create_with(*args); end
236
+
237
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
238
+ def distinct(*args); end
239
+
240
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
241
+ def references(*args); end
242
+
243
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
244
+ def none(*args); end
245
+
246
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
247
+ def unscope(*args); end
248
+
249
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
250
+ def merge(*args); end
251
+
252
+ sig { params(args: T.untyped).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
253
+ def except(*args); end
254
+
255
+ sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation) }
256
+ def extending(*args, &block); end
257
+
258
+ sig do
259
+ params(
260
+ of: T.nilable(Integer),
261
+ start: T.nilable(Integer),
262
+ finish: T.nilable(Integer),
263
+ load: T.nilable(T::Boolean),
264
+ error_on_ignore: T.nilable(T::Boolean),
265
+ block: T.nilable(T.proc.params(e: SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation).void)
266
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
267
+ end
268
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
269
+ end
270
+
271
+ class SpellBook::HABTM_Spells::ActiveRecord_Relation < ActiveRecord::Relation
272
+ include SpellBook::HABTM_Spells::ActiveRelation_WhereNot
273
+ include SpellBook::HABTM_Spells::CustomFinderMethods
274
+ include SpellBook::HABTM_Spells::QueryMethodsReturningRelation
275
+ Elem = type_member(fixed: SpellBook::HABTM_Spells)
276
+ end
277
+
278
+ class SpellBook::HABTM_Spells::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
279
+ include SpellBook::HABTM_Spells::ActiveRelation_WhereNot
280
+ include SpellBook::HABTM_Spells::CustomFinderMethods
281
+ include SpellBook::HABTM_Spells::QueryMethodsReturningAssociationRelation
282
+ Elem = type_member(fixed: SpellBook::HABTM_Spells)
283
+ end
284
+
285
+ class SpellBook::HABTM_Spells::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
286
+ include SpellBook::HABTM_Spells::CustomFinderMethods
287
+ include SpellBook::HABTM_Spells::QueryMethodsReturningAssociationRelation
288
+ Elem = type_member(fixed: SpellBook::HABTM_Spells)
289
+
290
+ sig { params(records: T.any(SpellBook::HABTM_Spells, T::Array[SpellBook::HABTM_Spells])).returns(T.self_type) }
291
+ def <<(*records); end
292
+
293
+ sig { params(records: T.any(SpellBook::HABTM_Spells, T::Array[SpellBook::HABTM_Spells])).returns(T.self_type) }
294
+ def append(*records); end
295
+
296
+ sig { params(records: T.any(SpellBook::HABTM_Spells, T::Array[SpellBook::HABTM_Spells])).returns(T.self_type) }
297
+ def push(*records); end
298
+
299
+ sig { params(records: T.any(SpellBook::HABTM_Spells, T::Array[SpellBook::HABTM_Spells])).returns(T.self_type) }
300
+ def concat(*records); end
301
+ end
@@ -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
 
@@ -179,10 +175,10 @@ module Squib::GeneratedAttributeMethods
179
175
  sig { returns(T::Boolean) }
180
176
  def id?; end
181
177
 
182
- sig { returns(T.nilable(String)) }
178
+ sig { returns(String) }
183
179
  def name; end
184
180
 
185
- sig { params(value: T.nilable(T.any(String, Symbol))).void }
181
+ sig { params(value: T.any(String, Symbol)).void }
186
182
  def name=(value); end
187
183
 
188
184
  sig { returns(T::Boolean) }
@@ -253,8 +249,6 @@ 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
 
@@ -264,9 +258,21 @@ module Squib::GeneratedAssociationMethods
264
258
  sig { returns(::SpellBook::ActiveRecord_Associations_CollectionProxy) }
265
259
  def spell_books; end
266
260
 
261
+ sig { returns(T::Array[Integer]) }
262
+ def spell_book_ids; end
263
+
267
264
  sig { params(value: T::Enumerable[::SpellBook]).void }
268
265
  def spell_books=(value); end
269
266
 
267
+ sig { returns(::Subject::ActiveRecord_Associations_CollectionProxy) }
268
+ def subjects; end
269
+
270
+ sig { returns(T::Array[Integer]) }
271
+ def subject_ids; end
272
+
273
+ sig { params(value: T::Enumerable[::Subject]).void }
274
+ def subjects=(value); end
275
+
270
276
  sig { returns(T.nilable(::Wand)) }
271
277
  def wand; end
272
278
 
@@ -296,8 +302,7 @@ class Squib < Wizard
296
302
  include Squib::GeneratedAttributeMethods
297
303
  include Squib::GeneratedAssociationMethods
298
304
  extend Squib::CustomFinderMethods
299
- extend T::Sig
300
- extend T::Generic
305
+ extend Squib::QueryMethodsReturningRelation
301
306
  RelationType = T.type_alias { T.any(Squib::ActiveRecord_Relation, Squib::ActiveRecord_Associations_CollectionProxy, Squib::ActiveRecord_AssociationRelation) }
302
307
 
303
308
  sig { returns(T::Hash[T.any(String, Symbol), String]) }
@@ -371,119 +376,12 @@ class Squib < Wizard
371
376
 
372
377
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
373
378
  def self.recent(*args); end
374
-
375
- sig { returns(Squib::ActiveRecord_Relation) }
376
- def self.all; end
377
-
378
- sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
379
- def self.unscoped(&block); end
380
-
381
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
382
- def self.select(*args); end
383
-
384
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
385
- def self.order(*args); end
386
-
387
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
388
- def self.reorder(*args); end
389
-
390
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
391
- def self.group(*args); end
392
-
393
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
394
- def self.limit(*args); end
395
-
396
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
397
- def self.offset(*args); end
398
-
399
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
400
- def self.joins(*args); end
401
-
402
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
403
- def self.left_joins(*args); end
404
-
405
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
406
- def self.left_outer_joins(*args); end
407
-
408
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
409
- def self.where(*args); end
410
-
411
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
412
- def self.rewhere(*args); end
413
-
414
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
415
- def self.preload(*args); end
416
-
417
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
418
- def self.eager_load(*args); end
419
-
420
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
421
- def self.includes(*args); end
422
-
423
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
424
- def self.from(*args); end
425
-
426
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
427
- def self.lock(*args); end
428
-
429
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
430
- def self.readonly(*args); end
431
-
432
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
433
- def self.or(*args); end
434
-
435
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
436
- def self.having(*args); end
437
-
438
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
439
- def self.create_with(*args); end
440
-
441
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
442
- def self.distinct(*args); end
443
-
444
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
445
- def self.references(*args); end
446
-
447
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
448
- def self.none(*args); end
449
-
450
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
451
- def self.unscope(*args); end
452
-
453
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
454
- def self.merge(*args); end
455
-
456
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
457
- def self.except(*args); end
458
-
459
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
460
- def self.extending(*args, &block); end
461
-
462
- sig { params(conditions: T.untyped).returns(T::Boolean) }
463
- def self.exists?(conditions = nil); end
464
-
465
- sig { params(args: T.untyped).returns(T::Boolean) }
466
- def self.any?(*args); end
467
-
468
- sig { params(args: T.untyped).returns(T::Boolean) }
469
- def self.many?(*args); end
470
-
471
- sig { params(args: T.untyped).returns(T::Boolean) }
472
- def self.none?(*args); end
473
-
474
- sig { params(args: T.untyped).returns(T::Boolean) }
475
- def self.one?(*args); end
476
-
477
- sig { params(args: T.untyped).returns(T::Boolean) }
478
- def self.empty?(*args); end
479
379
  end
480
380
 
481
381
  class Squib::ActiveRecord_Relation < ActiveRecord::Relation
482
382
  include Squib::ActiveRelation_WhereNot
483
383
  include Squib::CustomFinderMethods
484
- include Enumerable
485
- extend T::Sig
486
- extend T::Generic
384
+ include Squib::QueryMethodsReturningRelation
487
385
  Elem = type_member(fixed: Squib)
488
386
 
489
387
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
@@ -539,119 +437,72 @@ class Squib::ActiveRecord_Relation < ActiveRecord::Relation
539
437
 
540
438
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
541
439
  def recent(*args); end
440
+ end
542
441
 
543
- sig { returns(Squib::ActiveRecord_Relation) }
544
- def all; end
545
-
546
- sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
547
- def unscoped(&block); end
548
-
549
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
550
- def select(*args); end
551
-
552
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
553
- def order(*args); end
554
-
555
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
556
- def reorder(*args); end
557
-
558
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
559
- def group(*args); end
560
-
561
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
562
- def limit(*args); end
563
-
564
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
565
- def offset(*args); end
566
-
567
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
568
- def joins(*args); end
569
-
570
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
571
- def left_joins(*args); end
572
-
573
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
574
- def left_outer_joins(*args); end
575
-
576
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
577
- def where(*args); end
578
-
579
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
580
- def rewhere(*args); end
581
-
582
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
583
- def preload(*args); end
584
-
585
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
586
- def eager_load(*args); end
587
-
588
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
589
- def includes(*args); end
590
-
591
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
592
- def from(*args); end
442
+ class Squib::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
443
+ include Squib::ActiveRelation_WhereNot
444
+ include Squib::CustomFinderMethods
445
+ include Squib::QueryMethodsReturningAssociationRelation
446
+ Elem = type_member(fixed: Squib)
593
447
 
594
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
595
- def lock(*args); end
448
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
449
+ def Gryffindor(*args); end
596
450
 
597
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
598
- def readonly(*args); end
451
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
452
+ def Hagrid(*args); end
599
453
 
600
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
601
- def or(*args); end
454
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
455
+ def Hufflepuff(*args); end
602
456
 
603
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
604
- def having(*args); end
457
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
458
+ def Ravenclaw(*args); end
605
459
 
606
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
607
- def create_with(*args); end
460
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
461
+ def Slytherin(*args); end
608
462
 
609
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
610
- def distinct(*args); end
463
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
464
+ def black_hair(*args); end
611
465
 
612
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
613
- def references(*args); end
466
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
467
+ def blonde_hair(*args); end
614
468
 
615
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
616
- def none(*args); end
469
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
470
+ def broom_firebolt(*args); end
617
471
 
618
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
619
- def unscope(*args); end
472
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
473
+ def broom_nimbus(*args); end
620
474
 
621
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
622
- def merge(*args); end
475
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
476
+ def brown_hair(*args); end
623
477
 
624
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
625
- def except(*args); end
478
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
479
+ def color_blue_eyes(*args); end
626
480
 
627
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
628
- def extending(*args, &block); end
481
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
482
+ def color_brown_eyes(*args); end
629
483
 
630
- sig { params(conditions: T.untyped).returns(T::Boolean) }
631
- def exists?(conditions = nil); end
484
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
485
+ def color_green_eyes(*args); end
632
486
 
633
- sig { params(args: T.untyped).returns(T::Boolean) }
634
- def any?(*args); end
487
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
488
+ def quidditch_beater(*args); end
635
489
 
636
- sig { params(args: T.untyped).returns(T::Boolean) }
637
- def many?(*args); end
490
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
491
+ def quidditch_chaser(*args); end
638
492
 
639
- sig { params(args: T.untyped).returns(T::Boolean) }
640
- def none?(*args); end
493
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
494
+ def quidditch_keeper(*args); end
641
495
 
642
- sig { params(args: T.untyped).returns(T::Boolean) }
643
- def one?(*args); end
496
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
497
+ def quidditch_seeker(*args); end
644
498
 
645
- sig { params(args: T.untyped).returns(T::Boolean) }
646
- def empty?(*args); end
499
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
500
+ def recent(*args); end
647
501
  end
648
502
 
649
- class Squib::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
650
- include Squib::ActiveRelation_WhereNot
503
+ class Squib::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
651
504
  include Squib::CustomFinderMethods
652
- include Enumerable
653
- extend T::Sig
654
- extend T::Generic
505
+ include Squib::QueryMethodsReturningAssociationRelation
655
506
  Elem = type_member(fixed: Squib)
656
507
 
657
508
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
@@ -708,248 +559,125 @@ class Squib::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelatio
708
559
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
709
560
  def recent(*args); end
710
561
 
711
- sig { returns(Squib::ActiveRecord_AssociationRelation) }
562
+ sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
563
+ def <<(*records); end
564
+
565
+ sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
566
+ def append(*records); end
567
+
568
+ sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
569
+ def push(*records); end
570
+
571
+ sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
572
+ def concat(*records); end
573
+ end
574
+
575
+ module Squib::QueryMethodsReturningRelation
576
+ sig { returns(Squib::ActiveRecord_Relation) }
712
577
  def all; end
713
578
 
714
- sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_AssociationRelation) }
579
+ sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
715
580
  def unscoped(&block); end
716
581
 
717
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
582
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
718
583
  def select(*args); end
719
584
 
720
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
585
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
721
586
  def order(*args); end
722
587
 
723
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
588
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
724
589
  def reorder(*args); end
725
590
 
726
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
591
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
727
592
  def group(*args); end
728
593
 
729
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
594
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
730
595
  def limit(*args); end
731
596
 
732
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
597
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
733
598
  def offset(*args); end
734
599
 
735
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
600
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
736
601
  def joins(*args); end
737
602
 
738
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
603
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
739
604
  def left_joins(*args); end
740
605
 
741
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
606
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
742
607
  def left_outer_joins(*args); end
743
608
 
744
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
609
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
745
610
  def where(*args); end
746
611
 
747
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
612
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
748
613
  def rewhere(*args); end
749
614
 
750
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
615
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
751
616
  def preload(*args); end
752
617
 
753
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
618
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
754
619
  def eager_load(*args); end
755
620
 
756
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
621
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
757
622
  def includes(*args); end
758
623
 
759
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
624
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
760
625
  def from(*args); end
761
626
 
762
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
627
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
763
628
  def lock(*args); end
764
629
 
765
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
630
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
766
631
  def readonly(*args); end
767
632
 
768
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
633
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
769
634
  def or(*args); end
770
635
 
771
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
636
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
772
637
  def having(*args); end
773
638
 
774
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
639
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
775
640
  def create_with(*args); end
776
641
 
777
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
642
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
778
643
  def distinct(*args); end
779
644
 
780
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
645
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
781
646
  def references(*args); end
782
647
 
783
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
648
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
784
649
  def none(*args); end
785
650
 
786
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
651
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
787
652
  def unscope(*args); end
788
653
 
789
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
654
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
790
655
  def merge(*args); end
791
656
 
792
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
657
+ sig { params(args: T.untyped).returns(Squib::ActiveRecord_Relation) }
793
658
  def except(*args); end
794
659
 
795
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_AssociationRelation) }
660
+ sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
796
661
  def extending(*args, &block); end
797
662
 
798
- sig { params(args: T.untyped).returns(Squib) }
799
- def find(*args); end
800
-
801
- sig { params(args: T.untyped).returns(T.nilable(Squib)) }
802
- def find_by(*args); end
803
-
804
- sig { params(args: T.untyped).returns(Squib) }
805
- def find_by!(*args); end
806
-
807
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
808
- def find_or_initialize_by(attributes, &block); end
809
-
810
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
811
- def find_or_create_by(attributes, &block); end
812
-
813
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
814
- def find_or_create_by!(attributes, &block); end
815
-
816
- sig { returns(T.nilable(Squib)) }
817
- def first; end
818
-
819
- sig { returns(Squib) }
820
- def first!; end
821
-
822
- sig { returns(T.nilable(Squib)) }
823
- def second; end
824
-
825
- sig { returns(Squib) }
826
- def second!; end
827
-
828
- sig { returns(T.nilable(Squib)) }
829
- def third; end
830
-
831
- sig { returns(Squib) }
832
- def third!; end
833
-
834
- sig { returns(T.nilable(Squib)) }
835
- def third_to_last; end
836
-
837
- sig { returns(Squib) }
838
- def third_to_last!; end
839
-
840
- sig { returns(T.nilable(Squib)) }
841
- def second_to_last; end
842
-
843
- sig { returns(Squib) }
844
- def second_to_last!; end
845
-
846
- sig { returns(T.nilable(Squib)) }
847
- def last; end
848
-
849
- sig { returns(Squib) }
850
- def last!; end
851
-
852
- sig { params(conditions: T.untyped).returns(T::Boolean) }
853
- def exists?(conditions = nil); end
854
-
855
- sig { params(args: T.untyped).returns(T::Boolean) }
856
- def any?(*args); end
857
-
858
- sig { params(args: T.untyped).returns(T::Boolean) }
859
- def many?(*args); end
860
-
861
- sig { params(args: T.untyped).returns(T::Boolean) }
862
- def none?(*args); end
863
-
864
- sig { params(args: T.untyped).returns(T::Boolean) }
865
- def one?(*args); end
866
-
867
- sig { params(args: T.untyped).returns(T::Boolean) }
868
- def empty?(*args); end
869
-
870
- sig { override.params(block: T.proc.params(e: Squib).void).returns(T::Array[Squib]) }
871
- def each(&block); end
872
-
873
- sig { params(level: T.nilable(Integer)).returns(T::Array[Squib]) }
874
- def flatten(level); end
875
-
876
- sig { returns(T::Array[Squib]) }
877
- def to_a; end
878
-
879
663
  sig do
880
- type_parameters(:U).params(
881
- blk: T.proc.params(arg0: Elem).returns(T.type_parameter(:U)),
882
- )
883
- .returns(T::Array[T.type_parameter(:U)])
664
+ params(
665
+ of: T.nilable(Integer),
666
+ start: T.nilable(Integer),
667
+ finish: T.nilable(Integer),
668
+ load: T.nilable(T::Boolean),
669
+ error_on_ignore: T.nilable(T::Boolean),
670
+ block: T.nilable(T.proc.params(e: Squib::ActiveRecord_Relation).void)
671
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
884
672
  end
885
- def map(&blk); end
673
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
886
674
  end
887
675
 
888
- class Squib::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
889
- include Squib::CustomFinderMethods
890
- include Enumerable
891
- extend T::Sig
892
- extend T::Generic
893
- Elem = type_member(fixed: Squib)
894
-
895
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
896
- def Gryffindor(*args); end
897
-
898
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
899
- def Hagrid(*args); end
900
-
901
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
902
- def Hufflepuff(*args); end
903
-
904
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
905
- def Ravenclaw(*args); end
906
-
907
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
908
- def Slytherin(*args); end
909
-
910
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
911
- def black_hair(*args); end
912
-
913
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
914
- def blonde_hair(*args); end
915
-
916
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
917
- def broom_firebolt(*args); end
918
-
919
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
920
- def broom_nimbus(*args); end
921
-
922
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
923
- def brown_hair(*args); end
924
-
925
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
926
- def color_blue_eyes(*args); end
927
-
928
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
929
- def color_brown_eyes(*args); end
930
-
931
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
932
- def color_green_eyes(*args); end
933
-
934
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
935
- def quidditch_beater(*args); end
936
-
937
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
938
- def quidditch_chaser(*args); end
939
-
940
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
941
- def quidditch_keeper(*args); end
942
-
943
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
944
- def quidditch_seeker(*args); end
945
-
946
- sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
947
- def recent(*args); end
948
-
676
+ module Squib::QueryMethodsReturningAssociationRelation
949
677
  sig { returns(Squib::ActiveRecord_AssociationRelation) }
950
678
  def all; end
951
679
 
952
- sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_AssociationRelation) }
680
+ sig { params(block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
953
681
  def unscoped(&block); end
954
682
 
955
683
  sig { params(args: T.untyped).returns(Squib::ActiveRecord_AssociationRelation) }
@@ -1033,104 +761,15 @@ class Squib::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associati
1033
761
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_AssociationRelation) }
1034
762
  def extending(*args, &block); end
1035
763
 
1036
- sig { params(args: T.untyped).returns(Squib) }
1037
- def find(*args); end
1038
-
1039
- sig { params(args: T.untyped).returns(T.nilable(Squib)) }
1040
- def find_by(*args); end
1041
-
1042
- sig { params(args: T.untyped).returns(Squib) }
1043
- def find_by!(*args); end
1044
-
1045
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
1046
- def find_or_initialize_by(attributes, &block); end
1047
-
1048
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
1049
- def find_or_create_by(attributes, &block); end
1050
-
1051
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
1052
- def find_or_create_by!(attributes, &block); end
1053
-
1054
- sig { returns(T.nilable(Squib)) }
1055
- def first; end
1056
-
1057
- sig { returns(Squib) }
1058
- def first!; end
1059
-
1060
- sig { returns(T.nilable(Squib)) }
1061
- def second; end
1062
-
1063
- sig { returns(Squib) }
1064
- def second!; end
1065
-
1066
- sig { returns(T.nilable(Squib)) }
1067
- def third; end
1068
-
1069
- sig { returns(Squib) }
1070
- def third!; end
1071
-
1072
- sig { returns(T.nilable(Squib)) }
1073
- def third_to_last; end
1074
-
1075
- sig { returns(Squib) }
1076
- def third_to_last!; end
1077
-
1078
- sig { returns(T.nilable(Squib)) }
1079
- def second_to_last; end
1080
-
1081
- sig { returns(Squib) }
1082
- def second_to_last!; end
1083
-
1084
- sig { returns(T.nilable(Squib)) }
1085
- def last; end
1086
-
1087
- sig { returns(Squib) }
1088
- def last!; end
1089
-
1090
- sig { params(conditions: T.untyped).returns(T::Boolean) }
1091
- def exists?(conditions = nil); end
1092
-
1093
- sig { params(args: T.untyped).returns(T::Boolean) }
1094
- def any?(*args); end
1095
-
1096
- sig { params(args: T.untyped).returns(T::Boolean) }
1097
- def many?(*args); end
1098
-
1099
- sig { params(args: T.untyped).returns(T::Boolean) }
1100
- def none?(*args); end
1101
-
1102
- sig { params(args: T.untyped).returns(T::Boolean) }
1103
- def one?(*args); end
1104
-
1105
- sig { params(args: T.untyped).returns(T::Boolean) }
1106
- def empty?(*args); end
1107
-
1108
- sig { override.params(block: T.proc.params(e: Squib).void).returns(T::Array[Squib]) }
1109
- def each(&block); end
1110
-
1111
- sig { params(level: T.nilable(Integer)).returns(T::Array[Squib]) }
1112
- def flatten(level); end
1113
-
1114
- sig { returns(T::Array[Squib]) }
1115
- def to_a; end
1116
-
1117
764
  sig do
1118
- type_parameters(:U).params(
1119
- blk: T.proc.params(arg0: Elem).returns(T.type_parameter(:U)),
1120
- )
1121
- .returns(T::Array[T.type_parameter(:U)])
765
+ params(
766
+ of: T.nilable(Integer),
767
+ start: T.nilable(Integer),
768
+ finish: T.nilable(Integer),
769
+ load: T.nilable(T::Boolean),
770
+ error_on_ignore: T.nilable(T::Boolean),
771
+ block: T.nilable(T.proc.params(e: Squib::ActiveRecord_AssociationRelation).void)
772
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
1122
773
  end
1123
- def map(&blk); end
1124
-
1125
- sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
1126
- def <<(*records); end
1127
-
1128
- sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
1129
- def append(*records); end
1130
-
1131
- sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
1132
- def push(*records); end
1133
-
1134
- sig { params(records: T.any(Squib, T::Array[Squib])).returns(T.self_type) }
1135
- def concat(*records); end
774
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
1136
775
  end