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
@@ -3,8 +3,6 @@
3
3
 
4
4
  # typed: strong
5
5
  module Wand::EnumInstanceMethods
6
- extend T::Sig
7
-
8
6
  sig { returns(T::Boolean) }
9
7
  def phoenix_feather?; end
10
8
 
@@ -36,8 +34,6 @@ module Wand::ActiveRelation_WhereNot
36
34
  end
37
35
 
38
36
  module Wand::GeneratedAttributeMethods
39
- extend T::Sig
40
-
41
37
  sig { returns(T::Boolean) }
42
38
  def broken; end
43
39
 
@@ -158,17 +154,15 @@ end
158
154
 
159
155
  class Wand::CoreType < T::Enum
160
156
  enums do
161
- PhoenixFeather = new('phoenix_feather')
162
- DragonHeartstring = new('dragon_heartstring')
163
- UnicornTailHair = new('unicorn_tail_hair')
164
- BasiliskHorn = new('basilisk_horn')
157
+ PhoenixFeather = new(%q{phoenix_feather})
158
+ DragonHeartstring = new(%q{dragon_heartstring})
159
+ UnicornTailHair = new(%q{unicorn_tail_hair})
160
+ BasiliskHorn = new(%q{basilisk_horn})
165
161
  end
166
162
 
167
163
  end
168
164
 
169
165
  module Wand::GeneratedAssociationMethods
170
- extend T::Sig
171
-
172
166
  sig { returns(::Wizard) }
173
167
  def wizard; end
174
168
 
@@ -198,8 +192,7 @@ class Wand < ApplicationRecord
198
192
  include Wand::GeneratedAttributeMethods
199
193
  include Wand::GeneratedAssociationMethods
200
194
  extend Wand::CustomFinderMethods
201
- extend T::Sig
202
- extend T::Generic
195
+ extend Wand::QueryMethodsReturningRelation
203
196
  RelationType = T.type_alias { T.any(Wand::ActiveRecord_Relation, Wand::ActiveRecord_Associations_CollectionProxy, Wand::ActiveRecord_AssociationRelation) }
204
197
 
205
198
  sig { returns(T::Hash[T.any(String, Symbol), Integer]) }
@@ -217,138 +210,85 @@ class Wand < ApplicationRecord
217
210
  sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
218
211
  def self.unicorn_tail_hair(*args); end
219
212
 
220
- sig { returns(Wand::ActiveRecord_Relation) }
221
- def self.all; end
222
-
223
- sig { params(block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_Relation) }
224
- def self.unscoped(&block); end
225
-
226
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
227
- def self.select(*args); end
228
-
229
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
230
- def self.order(*args); end
231
-
232
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
233
- def self.reorder(*args); end
234
-
235
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
236
- def self.group(*args); end
237
-
238
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
239
- def self.limit(*args); end
240
-
241
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
242
- def self.offset(*args); end
243
-
244
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
245
- def self.joins(*args); end
246
-
247
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
248
- def self.left_joins(*args); end
249
-
250
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
251
- def self.left_outer_joins(*args); end
252
-
253
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
254
- def self.where(*args); end
255
-
256
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
257
- def self.rewhere(*args); end
258
-
259
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
260
- def self.preload(*args); end
261
-
262
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
263
- def self.eager_load(*args); end
264
-
265
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
266
- def self.includes(*args); end
267
-
268
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
269
- def self.from(*args); end
270
-
271
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
272
- def self.lock(*args); end
273
-
274
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
275
- def self.readonly(*args); end
276
-
277
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
278
- def self.or(*args); end
213
+ sig { returns(T.nilable(Wand::CoreType)) }
214
+ def typed_core_type; end
279
215
 
280
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
281
- def self.having(*args); end
216
+ sig { params(value: T.nilable(Wand::CoreType)).void }
217
+ def typed_core_type=(value); end
282
218
 
283
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
284
- def self.create_with(*args); end
219
+ sig { returns(T::Array[Wand]) }
220
+ def self.mythicals; end
221
+ end
285
222
 
286
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
287
- def self.distinct(*args); end
223
+ class Wand::ActiveRecord_Relation < ActiveRecord::Relation
224
+ include Wand::ActiveRelation_WhereNot
225
+ include Wand::CustomFinderMethods
226
+ include Wand::QueryMethodsReturningRelation
227
+ Elem = type_member(fixed: Wand)
288
228
 
289
229
  sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
290
- def self.references(*args); end
230
+ def basilisk_horn(*args); end
291
231
 
292
232
  sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
293
- def self.none(*args); end
233
+ def dragon_heartstring(*args); end
294
234
 
295
235
  sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
296
- def self.unscope(*args); end
236
+ def phoenix_feather(*args); end
297
237
 
298
238
  sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
299
- def self.except(*args); end
300
-
301
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_Relation) }
302
- def self.extending(*args, &block); end
303
-
304
- sig { returns(T.nilable(Wand::CoreType)) }
305
- def typed_core_type; end
306
-
307
- sig { params(value: T.nilable(Wand::CoreType)).void }
308
- def typed_core_type=(value); end
309
-
310
- sig { params(conditions: T.untyped).returns(T::Boolean) }
311
- def self.exists?(conditions = nil); end
312
-
313
- sig { params(args: T.untyped).returns(T::Boolean) }
314
- def self.any?(*args); end
239
+ def unicorn_tail_hair(*args); end
240
+ end
315
241
 
316
- sig { params(args: T.untyped).returns(T::Boolean) }
317
- def self.many?(*args); end
242
+ class Wand::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
243
+ include Wand::ActiveRelation_WhereNot
244
+ include Wand::CustomFinderMethods
245
+ include Wand::QueryMethodsReturningAssociationRelation
246
+ Elem = type_member(fixed: Wand)
318
247
 
319
- sig { params(args: T.untyped).returns(T::Boolean) }
320
- def self.none?(*args); end
248
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
249
+ def basilisk_horn(*args); end
321
250
 
322
- sig { params(args: T.untyped).returns(T::Boolean) }
323
- def self.one?(*args); end
251
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
252
+ def dragon_heartstring(*args); end
324
253
 
325
- sig { params(args: T.untyped).returns(T::Boolean) }
326
- def self.empty?(*args); end
254
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
255
+ def phoenix_feather(*args); end
327
256
 
328
- sig { returns(T::Array[Wand]) }
329
- def self.mythicals; end
257
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
258
+ def unicorn_tail_hair(*args); end
330
259
  end
331
260
 
332
- class Wand::ActiveRecord_Relation < ActiveRecord::Relation
333
- include Wand::ActiveRelation_WhereNot
261
+ class Wand::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
334
262
  include Wand::CustomFinderMethods
335
- include Enumerable
336
- extend T::Sig
337
- extend T::Generic
263
+ include Wand::QueryMethodsReturningAssociationRelation
338
264
  Elem = type_member(fixed: Wand)
339
265
 
340
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
266
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
341
267
  def basilisk_horn(*args); end
342
268
 
343
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
269
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
344
270
  def dragon_heartstring(*args); end
345
271
 
346
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
272
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
347
273
  def phoenix_feather(*args); end
348
274
 
349
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_Relation) }
275
+ sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
350
276
  def unicorn_tail_hair(*args); end
351
277
 
278
+ sig { params(records: T.any(Wand, T::Array[Wand])).returns(T.self_type) }
279
+ def <<(*records); end
280
+
281
+ sig { params(records: T.any(Wand, T::Array[Wand])).returns(T.self_type) }
282
+ def append(*records); end
283
+
284
+ sig { params(records: T.any(Wand, T::Array[Wand])).returns(T.self_type) }
285
+ def push(*records); end
286
+
287
+ sig { params(records: T.any(Wand, T::Array[Wand])).returns(T.self_type) }
288
+ def concat(*records); end
289
+ end
290
+
291
+ module Wand::QueryMethodsReturningRelation
352
292
  sig { returns(Wand::ActiveRecord_Relation) }
353
293
  def all; end
354
294
 
@@ -433,242 +373,24 @@ class Wand::ActiveRecord_Relation < ActiveRecord::Relation
433
373
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_Relation) }
434
374
  def extending(*args, &block); end
435
375
 
436
- sig { params(conditions: T.untyped).returns(T::Boolean) }
437
- def exists?(conditions = nil); end
438
-
439
- sig { params(args: T.untyped).returns(T::Boolean) }
440
- def any?(*args); end
441
-
442
- sig { params(args: T.untyped).returns(T::Boolean) }
443
- def many?(*args); end
444
-
445
- sig { params(args: T.untyped).returns(T::Boolean) }
446
- def none?(*args); end
447
-
448
- sig { params(args: T.untyped).returns(T::Boolean) }
449
- def one?(*args); end
450
-
451
- sig { params(args: T.untyped).returns(T::Boolean) }
452
- def empty?(*args); end
453
- end
454
-
455
- class Wand::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
456
- include Wand::ActiveRelation_WhereNot
457
- include Wand::CustomFinderMethods
458
- include Enumerable
459
- extend T::Sig
460
- extend T::Generic
461
- Elem = type_member(fixed: Wand)
462
-
463
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
464
- def basilisk_horn(*args); end
465
-
466
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
467
- def dragon_heartstring(*args); end
468
-
469
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
470
- def phoenix_feather(*args); end
471
-
472
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
473
- def unicorn_tail_hair(*args); end
474
-
475
- sig { returns(Wand::ActiveRecord_AssociationRelation) }
476
- def all; end
477
-
478
- sig { params(block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_AssociationRelation) }
479
- def unscoped(&block); end
480
-
481
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
482
- def select(*args); end
483
-
484
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
485
- def order(*args); end
486
-
487
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
488
- def reorder(*args); end
489
-
490
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
491
- def group(*args); end
492
-
493
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
494
- def limit(*args); end
495
-
496
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
497
- def offset(*args); end
498
-
499
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
500
- def joins(*args); end
501
-
502
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
503
- def left_joins(*args); end
504
-
505
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
506
- def left_outer_joins(*args); end
507
-
508
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
509
- def where(*args); end
510
-
511
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
512
- def rewhere(*args); end
513
-
514
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
515
- def preload(*args); end
516
-
517
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
518
- def eager_load(*args); end
519
-
520
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
521
- def includes(*args); end
522
-
523
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
524
- def from(*args); end
525
-
526
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
527
- def lock(*args); end
528
-
529
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
530
- def readonly(*args); end
531
-
532
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
533
- def or(*args); end
534
-
535
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
536
- def having(*args); end
537
-
538
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
539
- def create_with(*args); end
540
-
541
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
542
- def distinct(*args); end
543
-
544
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
545
- def references(*args); end
546
-
547
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
548
- def none(*args); end
549
-
550
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
551
- def unscope(*args); end
552
-
553
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
554
- def except(*args); end
555
-
556
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_AssociationRelation) }
557
- def extending(*args, &block); end
558
-
559
- sig { params(args: T.untyped).returns(Wand) }
560
- def find(*args); end
561
-
562
- sig { params(args: T.untyped).returns(T.nilable(Wand)) }
563
- def find_by(*args); end
564
-
565
- sig { params(args: T.untyped).returns(Wand) }
566
- def find_by!(*args); end
567
-
568
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
569
- def find_or_initialize_by(attributes, &block); end
570
-
571
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
572
- def find_or_create_by(attributes, &block); end
573
-
574
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
575
- def find_or_create_by!(attributes, &block); end
576
-
577
- sig { returns(T.nilable(Wand)) }
578
- def first; end
579
-
580
- sig { returns(Wand) }
581
- def first!; end
582
-
583
- sig { returns(T.nilable(Wand)) }
584
- def second; end
585
-
586
- sig { returns(Wand) }
587
- def second!; end
588
-
589
- sig { returns(T.nilable(Wand)) }
590
- def third; end
591
-
592
- sig { returns(Wand) }
593
- def third!; end
594
-
595
- sig { returns(T.nilable(Wand)) }
596
- def third_to_last; end
597
-
598
- sig { returns(Wand) }
599
- def third_to_last!; end
600
-
601
- sig { returns(T.nilable(Wand)) }
602
- def second_to_last; end
603
-
604
- sig { returns(Wand) }
605
- def second_to_last!; end
606
-
607
- sig { returns(T.nilable(Wand)) }
608
- def last; end
609
-
610
- sig { returns(Wand) }
611
- def last!; end
612
-
613
- sig { params(conditions: T.untyped).returns(T::Boolean) }
614
- def exists?(conditions = nil); end
615
-
616
- sig { params(args: T.untyped).returns(T::Boolean) }
617
- def any?(*args); end
618
-
619
- sig { params(args: T.untyped).returns(T::Boolean) }
620
- def many?(*args); end
621
-
622
- sig { params(args: T.untyped).returns(T::Boolean) }
623
- def none?(*args); end
624
-
625
- sig { params(args: T.untyped).returns(T::Boolean) }
626
- def one?(*args); end
627
-
628
- sig { params(args: T.untyped).returns(T::Boolean) }
629
- def empty?(*args); end
630
-
631
- sig { override.params(block: T.proc.params(e: Wand).void).returns(T::Array[Wand]) }
632
- def each(&block); end
633
-
634
- sig { params(level: T.nilable(Integer)).returns(T::Array[Wand]) }
635
- def flatten(level); end
636
-
637
- sig { returns(T::Array[Wand]) }
638
- def to_a; end
639
-
640
376
  sig do
641
- type_parameters(:U).params(
642
- blk: T.proc.params(arg0: Elem).returns(T.type_parameter(:U)),
643
- )
644
- .returns(T::Array[T.type_parameter(:U)])
377
+ params(
378
+ of: T.nilable(Integer),
379
+ start: T.nilable(Integer),
380
+ finish: T.nilable(Integer),
381
+ load: T.nilable(T::Boolean),
382
+ error_on_ignore: T.nilable(T::Boolean),
383
+ block: T.nilable(T.proc.params(e: Wand::ActiveRecord_Relation).void)
384
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
645
385
  end
646
- def map(&blk); end
386
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
647
387
  end
648
388
 
649
- class Wand::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
650
- include Wand::CustomFinderMethods
651
- include Enumerable
652
- extend T::Sig
653
- extend T::Generic
654
- Elem = type_member(fixed: Wand)
655
-
656
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
657
- def basilisk_horn(*args); end
658
-
659
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
660
- def dragon_heartstring(*args); end
661
-
662
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
663
- def phoenix_feather(*args); end
664
-
665
- sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
666
- def unicorn_tail_hair(*args); end
667
-
389
+ module Wand::QueryMethodsReturningAssociationRelation
668
390
  sig { returns(Wand::ActiveRecord_AssociationRelation) }
669
391
  def all; end
670
392
 
671
- sig { params(block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_AssociationRelation) }
393
+ sig { params(block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_Relation) }
672
394
  def unscoped(&block); end
673
395
 
674
396
  sig { params(args: T.untyped).returns(Wand::ActiveRecord_AssociationRelation) }
@@ -749,104 +471,15 @@ class Wand::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associatio
749
471
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_AssociationRelation) }
750
472
  def extending(*args, &block); end
751
473
 
752
- sig { params(args: T.untyped).returns(Wand) }
753
- def find(*args); end
754
-
755
- sig { params(args: T.untyped).returns(T.nilable(Wand)) }
756
- def find_by(*args); end
757
-
758
- sig { params(args: T.untyped).returns(Wand) }
759
- def find_by!(*args); end
760
-
761
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
762
- def find_or_initialize_by(attributes, &block); end
763
-
764
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
765
- def find_or_create_by(attributes, &block); end
766
-
767
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
768
- def find_or_create_by!(attributes, &block); end
769
-
770
- sig { returns(T.nilable(Wand)) }
771
- def first; end
772
-
773
- sig { returns(Wand) }
774
- def first!; end
775
-
776
- sig { returns(T.nilable(Wand)) }
777
- def second; end
778
-
779
- sig { returns(Wand) }
780
- def second!; end
781
-
782
- sig { returns(T.nilable(Wand)) }
783
- def third; end
784
-
785
- sig { returns(Wand) }
786
- def third!; end
787
-
788
- sig { returns(T.nilable(Wand)) }
789
- def third_to_last; end
790
-
791
- sig { returns(Wand) }
792
- def third_to_last!; end
793
-
794
- sig { returns(T.nilable(Wand)) }
795
- def second_to_last; end
796
-
797
- sig { returns(Wand) }
798
- def second_to_last!; end
799
-
800
- sig { returns(T.nilable(Wand)) }
801
- def last; end
802
-
803
- sig { returns(Wand) }
804
- def last!; end
805
-
806
- sig { params(conditions: T.untyped).returns(T::Boolean) }
807
- def exists?(conditions = nil); end
808
-
809
- sig { params(args: T.untyped).returns(T::Boolean) }
810
- def any?(*args); end
811
-
812
- sig { params(args: T.untyped).returns(T::Boolean) }
813
- def many?(*args); end
814
-
815
- sig { params(args: T.untyped).returns(T::Boolean) }
816
- def none?(*args); end
817
-
818
- sig { params(args: T.untyped).returns(T::Boolean) }
819
- def one?(*args); end
820
-
821
- sig { params(args: T.untyped).returns(T::Boolean) }
822
- def empty?(*args); end
823
-
824
- sig { override.params(block: T.proc.params(e: Wand).void).returns(T::Array[Wand]) }
825
- def each(&block); end
826
-
827
- sig { params(level: T.nilable(Integer)).returns(T::Array[Wand]) }
828
- def flatten(level); end
829
-
830
- sig { returns(T::Array[Wand]) }
831
- def to_a; end
832
-
833
474
  sig do
834
- type_parameters(:U).params(
835
- blk: T.proc.params(arg0: Elem).returns(T.type_parameter(:U)),
836
- )
837
- .returns(T::Array[T.type_parameter(:U)])
475
+ params(
476
+ of: T.nilable(Integer),
477
+ start: T.nilable(Integer),
478
+ finish: T.nilable(Integer),
479
+ load: T.nilable(T::Boolean),
480
+ error_on_ignore: T.nilable(T::Boolean),
481
+ block: T.nilable(T.proc.params(e: Wand::ActiveRecord_AssociationRelation).void)
482
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
838
483
  end
839
- def map(&blk); end
840
-
841
- sig { params(records: T.any(Wand, T::Array[Wand])).returns(T.self_type) }
842
- def <<(*records); end
843
-
844
- sig { params(records: T.any(Wand, T::Array[Wand])).returns(T.self_type) }
845
- def append(*records); end
846
-
847
- sig { params(records: T.any(Wand, T::Array[Wand])).returns(T.self_type) }
848
- def push(*records); end
849
-
850
- sig { params(records: T.any(Wand, T::Array[Wand])).returns(T.self_type) }
851
- def concat(*records); end
484
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
852
485
  end