sorbet-rails 0.6.3 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +1 -2
  3. data/.gitignore +2 -1
  4. data/.travis.yml +3 -1
  5. data/README.md +54 -7
  6. data/Rakefile +3 -3
  7. data/lib/bundled_rbi/customizabel_rbi_formatter.rbi +29 -0
  8. data/lib/bundled_rbi/pluck_to_tstruct.rbi +2 -1
  9. data/lib/bundled_rbi/typed_enum.rbi +7 -0
  10. data/lib/sorbet-rails.rb +1 -3
  11. data/lib/sorbet-rails/active_record_rbi_formatter.rb +8 -2
  12. data/lib/sorbet-rails/config.rb +11 -0
  13. data/lib/sorbet-rails/deprecation.rb +1 -0
  14. data/lib/sorbet-rails/gem_plugins/active_flag_plugin.rb +0 -1
  15. data/lib/sorbet-rails/gem_plugins/kaminari_plugin.rb +8 -0
  16. data/lib/sorbet-rails/gem_plugins/paperclip_plugin.rb +0 -1
  17. data/lib/sorbet-rails/job_rbi_formatter.rb +73 -62
  18. data/lib/sorbet-rails/mailer_rbi_formatter.rb +40 -27
  19. data/lib/sorbet-rails/model_column_utils.rb +129 -0
  20. data/lib/sorbet-rails/model_plugins/active_record_assoc.rb +37 -3
  21. data/lib/sorbet-rails/model_plugins/active_record_attribute.rb +0 -103
  22. data/lib/sorbet-rails/model_plugins/active_record_enum.rb +0 -1
  23. data/lib/sorbet-rails/model_plugins/active_record_named_scope.rb +15 -6
  24. data/lib/sorbet-rails/model_plugins/active_record_querying.rb +34 -3
  25. data/lib/sorbet-rails/model_plugins/active_storage_methods.rb +1 -1
  26. data/lib/sorbet-rails/model_plugins/base.rb +0 -9
  27. data/lib/sorbet-rails/model_rbi_formatter.rb +4 -8
  28. data/lib/sorbet-rails/model_utils.rb +73 -32
  29. data/lib/sorbet-rails/rails_mixins/generated_url_helpers.rb +2 -3
  30. data/lib/sorbet-rails/rails_mixins/pluck_to_tstruct.rb +17 -7
  31. data/lib/sorbet-rails/railtie.rb +0 -2
  32. data/lib/sorbet-rails/sorbet_utils.rb +152 -150
  33. data/lib/sorbet-rails/tasks/rails_rbi.rake +18 -26
  34. data/sorbet-rails.gemspec +1 -1
  35. data/spec/generators/rails-template.rb +3 -6
  36. data/spec/generators/sorbet_test_cases.rb +66 -88
  37. data/spec/job_rbi_formatter_spec.rb +1 -1
  38. data/spec/pluck_to_tstruct_spec.rb +74 -1
  39. data/spec/rails_helper.rb +2 -2
  40. data/spec/rake_rails_rbi_jobs_spec.rb +20 -0
  41. data/spec/rake_rails_rbi_mailers_spec.rb +21 -0
  42. data/spec/support/v5.0/Gemfile +1 -1
  43. data/spec/support/v5.0/Gemfile.lock +9 -9
  44. data/spec/support/v5.0/app/models/spell_book.rb +2 -0
  45. data/spec/support/v5.0/app/models/wizard.rb +1 -1
  46. data/spec/support/v5.0/sorbet_test_cases.rb +66 -88
  47. data/spec/support/v5.1/Gemfile.lock +7 -7
  48. data/spec/support/v5.1/app/models/spell_book.rb +2 -0
  49. data/spec/support/v5.1/app/models/wizard.rb +1 -1
  50. data/spec/support/v5.1/sorbet_test_cases.rb +66 -88
  51. data/spec/support/v5.2/Gemfile +1 -1
  52. data/spec/support/v5.2/Gemfile.lock +9 -9
  53. data/spec/support/v5.2/app/models/spell_book.rb +2 -0
  54. data/spec/support/v5.2/app/models/wizard.rb +1 -1
  55. data/spec/support/v5.2/sorbet_test_cases.rb +66 -88
  56. data/spec/support/v6.0/.gitignore +6 -0
  57. data/spec/support/v6.0/Gemfile +3 -3
  58. data/spec/support/v6.0/Gemfile.lock +77 -76
  59. data/spec/support/v6.0/app/models/spell_book.rb +2 -0
  60. data/spec/support/v6.0/app/models/wizard.rb +1 -1
  61. data/spec/support/v6.0/bin/bundle +22 -13
  62. data/spec/support/v6.0/config/environments/test.rb +1 -1
  63. data/spec/support/v6.0/sorbet_test_cases.rb +66 -88
  64. data/spec/support/v6.0/tmp/pids/.keep +0 -0
  65. data/spec/test_data/v5.0/expected_active_record_base.rbi +2 -2
  66. data/spec/test_data/v5.0/expected_active_record_relation.rbi +2 -2
  67. data/spec/test_data/v5.0/expected_custom_application_job.rbi +21 -0
  68. data/spec/test_data/v5.0/expected_custom_application_mailer.rbi +6 -0
  69. data/spec/test_data/v5.0/expected_custom_award_house_point_hourglasses.rbi +21 -0
  70. data/spec/test_data/v5.0/expected_custom_daily_prophet_mailer.rbi +8 -0
  71. data/spec/test_data/v5.0/expected_custom_hogwarts_acceptance_mailer.rbi +21 -0
  72. data/spec/test_data/v5.0/expected_headmaster.rbi +60 -190
  73. data/spec/test_data/v5.0/expected_internal_metadata.rbi +42 -188
  74. data/spec/test_data/v5.0/expected_potion.rbi +51 -188
  75. data/spec/test_data/v5.0/expected_robe.rbi +51 -190
  76. data/spec/test_data/v5.0/expected_schema_migration.rbi +42 -188
  77. data/spec/test_data/v5.0/expected_school.rbi +51 -190
  78. data/spec/test_data/v5.0/expected_spell.rbi +42 -190
  79. data/spec/test_data/v5.0/expected_spell/habtm_spell_books.rbi +60 -190
  80. data/spec/test_data/v5.0/expected_spell_book.rbi +86 -215
  81. data/spec/test_data/v5.0/expected_spell_book/habtm_spells.rbi +60 -190
  82. data/spec/test_data/v5.0/expected_squib.rbi +131 -263
  83. data/spec/test_data/v5.0/expected_subject.rbi +42 -190
  84. data/spec/test_data/v5.0/expected_subject/habtm_wizards.rbi +60 -190
  85. data/spec/test_data/v5.0/expected_wand.rbi +84 -225
  86. data/spec/test_data/v5.0/expected_wizard.rbi +131 -263
  87. data/spec/test_data/v5.0/expected_wizard/habtm_subjects.rbi +60 -190
  88. data/spec/test_data/v5.0/expected_wizard_wo_spellbook.rbi +131 -263
  89. data/spec/test_data/v5.1/expected_active_record_base.rbi +2 -2
  90. data/spec/test_data/v5.1/expected_active_record_relation.rbi +2 -2
  91. data/spec/test_data/v5.1/expected_custom_application_job.rbi +21 -0
  92. data/spec/test_data/v5.1/expected_custom_application_mailer.rbi +6 -0
  93. data/spec/test_data/v5.1/expected_custom_award_house_point_hourglasses.rbi +21 -0
  94. data/spec/test_data/v5.1/expected_custom_daily_prophet_mailer.rbi +8 -0
  95. data/spec/test_data/v5.1/expected_custom_hogwarts_acceptance_mailer.rbi +21 -0
  96. data/spec/test_data/v5.1/expected_headmaster.rbi +60 -196
  97. data/spec/test_data/v5.1/expected_internal_metadata.rbi +42 -194
  98. data/spec/test_data/v5.1/expected_potion.rbi +51 -194
  99. data/spec/test_data/v5.1/expected_robe.rbi +51 -196
  100. data/spec/test_data/v5.1/expected_schema_migration.rbi +42 -194
  101. data/spec/test_data/v5.1/expected_school.rbi +51 -196
  102. data/spec/test_data/v5.1/expected_spell.rbi +42 -196
  103. data/spec/test_data/v5.1/expected_spell/habtm_spell_books.rbi +60 -196
  104. data/spec/test_data/v5.1/expected_spell_book.rbi +86 -221
  105. data/spec/test_data/v5.1/expected_spell_book/habtm_spells.rbi +60 -196
  106. data/spec/test_data/v5.1/expected_squib.rbi +132 -270
  107. data/spec/test_data/v5.1/expected_subject.rbi +42 -196
  108. data/spec/test_data/v5.1/expected_subject/habtm_wizards.rbi +60 -196
  109. data/spec/test_data/v5.1/expected_wand.rbi +84 -231
  110. data/spec/test_data/v5.1/expected_wizard.rbi +132 -270
  111. data/spec/test_data/v5.1/expected_wizard/habtm_subjects.rbi +60 -196
  112. data/spec/test_data/v5.1/expected_wizard_wo_spellbook.rbi +132 -270
  113. data/spec/test_data/v5.2/expected_active_record_base.rbi +2 -2
  114. data/spec/test_data/v5.2/expected_active_record_relation.rbi +2 -2
  115. data/spec/test_data/v5.2/expected_attachment.rbi +60 -194
  116. data/spec/test_data/v5.2/expected_blob.rbi +80 -214
  117. data/spec/test_data/v5.2/expected_custom_application_job.rbi +21 -0
  118. data/spec/test_data/v5.2/expected_custom_application_mailer.rbi +6 -0
  119. data/spec/test_data/v5.2/expected_custom_award_house_point_hourglasses.rbi +21 -0
  120. data/spec/test_data/v5.2/expected_custom_daily_prophet_mailer.rbi +8 -0
  121. data/spec/test_data/v5.2/expected_custom_hogwarts_acceptance_mailer.rbi +21 -0
  122. data/spec/test_data/v5.2/expected_headmaster.rbi +60 -196
  123. data/spec/test_data/v5.2/expected_internal_metadata.rbi +42 -194
  124. data/spec/test_data/v5.2/expected_potion.rbi +51 -194
  125. data/spec/test_data/v5.2/expected_robe.rbi +51 -196
  126. data/spec/test_data/v5.2/expected_schema_migration.rbi +42 -194
  127. data/spec/test_data/v5.2/expected_school.rbi +51 -196
  128. data/spec/test_data/v5.2/expected_spell.rbi +42 -196
  129. data/spec/test_data/v5.2/expected_spell/habtm_spell_books.rbi +60 -196
  130. data/spec/test_data/v5.2/expected_spell_book.rbi +86 -221
  131. data/spec/test_data/v5.2/expected_spell_book/habtm_spells.rbi +60 -196
  132. data/spec/test_data/v5.2/expected_squib.rbi +156 -276
  133. data/spec/test_data/v5.2/expected_subject.rbi +42 -196
  134. data/spec/test_data/v5.2/expected_subject/habtm_wizards.rbi +60 -196
  135. data/spec/test_data/v5.2/expected_wand.rbi +84 -231
  136. data/spec/test_data/v5.2/expected_wizard.rbi +156 -276
  137. data/spec/test_data/v5.2/expected_wizard/habtm_subjects.rbi +60 -196
  138. data/spec/test_data/v5.2/expected_wizard_wo_spellbook.rbi +156 -276
  139. data/spec/test_data/v6.0/expected_active_record_base.rbi +2 -2
  140. data/spec/test_data/v6.0/expected_active_record_relation.rbi +10 -10
  141. data/spec/test_data/v6.0/expected_attachment.rbi +60 -218
  142. data/spec/test_data/v6.0/expected_blob.rbi +80 -238
  143. data/spec/test_data/v6.0/expected_custom_application_job.rbi +21 -0
  144. data/spec/test_data/v6.0/expected_custom_application_mailer.rbi +6 -0
  145. data/spec/test_data/v6.0/expected_custom_award_house_point_hourglasses.rbi +21 -0
  146. data/spec/test_data/v6.0/expected_custom_daily_prophet_mailer.rbi +8 -0
  147. data/spec/test_data/v6.0/expected_custom_hogwarts_acceptance_mailer.rbi +21 -0
  148. data/spec/test_data/v6.0/expected_headmaster.rbi +60 -220
  149. data/spec/test_data/v6.0/expected_internal_metadata.rbi +42 -218
  150. data/spec/test_data/v6.0/expected_potion.rbi +51 -218
  151. data/spec/test_data/v6.0/expected_robe.rbi +51 -220
  152. data/spec/test_data/v6.0/expected_routes.rbi +14 -7
  153. data/spec/test_data/v6.0/expected_schema_migration.rbi +42 -218
  154. data/spec/test_data/v6.0/expected_school.rbi +51 -220
  155. data/spec/test_data/v6.0/expected_spell.rbi +42 -220
  156. data/spec/test_data/v6.0/expected_spell/habtm_spell_books.rbi +60 -220
  157. data/spec/test_data/v6.0/expected_spell_book.rbi +98 -257
  158. data/spec/test_data/v6.0/expected_spell_book/habtm_spells.rbi +60 -220
  159. data/spec/test_data/v6.0/expected_squib.rbi +182 -326
  160. data/spec/test_data/v6.0/expected_subject.rbi +42 -220
  161. data/spec/test_data/v6.0/expected_subject/habtm_wizards.rbi +60 -220
  162. data/spec/test_data/v6.0/expected_wand.rbi +100 -271
  163. data/spec/test_data/v6.0/expected_wizard.rbi +182 -326
  164. data/spec/test_data/v6.0/expected_wizard/habtm_subjects.rbi +60 -220
  165. data/spec/test_data/v6.0/expected_wizard_wo_spellbook.rbi +182 -326
  166. metadata +46 -11
  167. data/lib/bundled_rbi/parameters.rbi +0 -28
  168. data/lib/sorbet-rails/custom_types/boolean_string.rb +0 -42
  169. data/lib/sorbet-rails/custom_types/integer_string.rb +0 -45
  170. data/lib/sorbet-rails/rails_mixins/custom_params_methods.rb +0 -57
  171. data/spec/boolean_string_spec.rb +0 -59
  172. data/spec/custom_params_methods_spec.rb +0 -138
  173. data/spec/integer_string_spec.rb +0 -46
@@ -8,8 +8,6 @@ module Spell::ActiveRelation_WhereNot
8
8
  end
9
9
 
10
10
  module Spell::GeneratedAttributeMethods
11
- extend T::Sig
12
-
13
11
  sig { returns(Integer) }
14
12
  def id; end
15
13
 
@@ -30,8 +28,6 @@ module Spell::GeneratedAttributeMethods
30
28
  end
31
29
 
32
30
  module Spell::GeneratedAssociationMethods
33
- extend T::Sig
34
-
35
31
  sig { returns(::SpellBook::ActiveRecord_Associations_CollectionProxy) }
36
32
  def spell_books; end
37
33
 
@@ -63,102 +59,11 @@ class Spell < ApplicationRecord
63
59
  include Spell::GeneratedAttributeMethods
64
60
  include Spell::GeneratedAssociationMethods
65
61
  extend Spell::CustomFinderMethods
66
- extend T::Sig
67
- extend T::Generic
62
+ extend Spell::QueryMethodsReturningRelation
68
63
  RelationType = T.type_alias { T.any(Spell::ActiveRecord_Relation, Spell::ActiveRecord_Associations_CollectionProxy, Spell::ActiveRecord_AssociationRelation) }
69
-
70
- sig { returns(Spell::ActiveRecord_Relation) }
71
- def self.all; end
72
-
73
- sig { params(block: T.nilable(T.proc.void)).returns(Spell::ActiveRecord_Relation) }
74
- def self.unscoped(&block); end
75
-
76
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
77
- def self.select(*args); end
78
-
79
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
80
- def self.order(*args); end
81
-
82
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
83
- def self.reorder(*args); end
84
-
85
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
86
- def self.group(*args); end
87
-
88
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
89
- def self.limit(*args); end
90
-
91
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
92
- def self.offset(*args); end
93
-
94
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
95
- def self.joins(*args); end
96
-
97
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
98
- def self.left_joins(*args); end
99
-
100
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
101
- def self.left_outer_joins(*args); end
102
-
103
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
104
- def self.where(*args); end
105
-
106
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
107
- def self.rewhere(*args); end
108
-
109
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
110
- def self.preload(*args); end
111
-
112
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
113
- def self.eager_load(*args); end
114
-
115
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
116
- def self.includes(*args); end
117
-
118
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
119
- def self.from(*args); end
120
-
121
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
122
- def self.lock(*args); end
123
-
124
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
125
- def self.readonly(*args); end
126
-
127
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
128
- def self.or(*args); end
129
-
130
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
131
- def self.having(*args); end
132
-
133
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
134
- def self.create_with(*args); end
135
-
136
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
137
- def self.distinct(*args); end
138
-
139
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
140
- def self.references(*args); end
141
-
142
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
143
- def self.none(*args); end
144
-
145
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
146
- def self.unscope(*args); end
147
-
148
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_Relation) }
149
- def self.except(*args); end
150
-
151
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Spell::ActiveRecord_Relation) }
152
- def self.extending(*args, &block); end
153
64
  end
154
65
 
155
- class Spell::ActiveRecord_Relation < ActiveRecord::Relation
156
- include Spell::ActiveRelation_WhereNot
157
- include Spell::CustomFinderMethods
158
- extend T::Sig
159
- extend T::Generic
160
- Elem = type_member(fixed: Spell)
161
-
66
+ module Spell::QueryMethodsReturningRelation
162
67
  sig { returns(Spell::ActiveRecord_Relation) }
163
68
  def all; end
164
69
 
@@ -242,19 +147,25 @@ class Spell::ActiveRecord_Relation < ActiveRecord::Relation
242
147
 
243
148
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Spell::ActiveRecord_Relation) }
244
149
  def extending(*args, &block); end
245
- end
246
150
 
247
- class Spell::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
248
- include Spell::ActiveRelation_WhereNot
249
- include Spell::CustomFinderMethods
250
- extend T::Sig
251
- extend T::Generic
252
- Elem = type_member(fixed: Spell)
151
+ sig do
152
+ params(
153
+ of: T.nilable(Integer),
154
+ start: T.nilable(Integer),
155
+ finish: T.nilable(Integer),
156
+ load: T.nilable(T::Boolean),
157
+ error_on_ignore: T.nilable(T::Boolean),
158
+ block: T.nilable(T.proc.params(e: Spell::ActiveRecord_Relation).void)
159
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
160
+ end
161
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
162
+ end
253
163
 
164
+ module Spell::QueryMethodsReturningAssociationRelation
254
165
  sig { returns(Spell::ActiveRecord_AssociationRelation) }
255
166
  def all; end
256
167
 
257
- sig { params(block: T.nilable(T.proc.void)).returns(Spell::ActiveRecord_AssociationRelation) }
168
+ sig { params(block: T.nilable(T.proc.void)).returns(Spell::ActiveRecord_Relation) }
258
169
  def unscoped(&block); end
259
170
 
260
171
  sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
@@ -334,97 +245,38 @@ class Spell::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelatio
334
245
 
335
246
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Spell::ActiveRecord_AssociationRelation) }
336
247
  def extending(*args, &block); end
248
+
249
+ sig do
250
+ params(
251
+ of: T.nilable(Integer),
252
+ start: T.nilable(Integer),
253
+ finish: T.nilable(Integer),
254
+ load: T.nilable(T::Boolean),
255
+ error_on_ignore: T.nilable(T::Boolean),
256
+ block: T.nilable(T.proc.params(e: Spell::ActiveRecord_AssociationRelation).void)
257
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
258
+ end
259
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
337
260
  end
338
261
 
339
- class Spell::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
262
+ class Spell::ActiveRecord_Relation < ActiveRecord::Relation
263
+ include Spell::ActiveRelation_WhereNot
340
264
  include Spell::CustomFinderMethods
341
- extend T::Sig
342
- extend T::Generic
265
+ include Spell::QueryMethodsReturningRelation
343
266
  Elem = type_member(fixed: Spell)
267
+ end
344
268
 
345
- sig { returns(Spell::ActiveRecord_AssociationRelation) }
346
- def all; end
347
-
348
- sig { params(block: T.nilable(T.proc.void)).returns(Spell::ActiveRecord_AssociationRelation) }
349
- def unscoped(&block); end
350
-
351
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
352
- def select(*args); end
353
-
354
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
355
- def order(*args); end
356
-
357
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
358
- def reorder(*args); end
359
-
360
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
361
- def group(*args); end
362
-
363
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
364
- def limit(*args); end
365
-
366
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
367
- def offset(*args); end
368
-
369
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
370
- def joins(*args); end
371
-
372
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
373
- def left_joins(*args); end
374
-
375
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
376
- def left_outer_joins(*args); end
377
-
378
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
379
- def where(*args); end
380
-
381
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
382
- def rewhere(*args); end
383
-
384
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
385
- def preload(*args); end
386
-
387
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
388
- def eager_load(*args); end
389
-
390
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
391
- def includes(*args); end
392
-
393
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
394
- def from(*args); end
395
-
396
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
397
- def lock(*args); end
398
-
399
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
400
- def readonly(*args); end
401
-
402
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
403
- def or(*args); end
404
-
405
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
406
- def having(*args); end
407
-
408
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
409
- def create_with(*args); end
410
-
411
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
412
- def distinct(*args); end
413
-
414
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
415
- def references(*args); end
416
-
417
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
418
- def none(*args); end
419
-
420
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
421
- def unscope(*args); end
422
-
423
- sig { params(args: T.untyped).returns(Spell::ActiveRecord_AssociationRelation) }
424
- def except(*args); end
269
+ class Spell::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
270
+ include Spell::ActiveRelation_WhereNot
271
+ include Spell::CustomFinderMethods
272
+ include Spell::QueryMethodsReturningAssociationRelation
273
+ Elem = type_member(fixed: Spell)
274
+ end
425
275
 
426
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Spell::ActiveRecord_AssociationRelation) }
427
- def extending(*args, &block); end
276
+ class Spell::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
277
+ include Spell::CustomFinderMethods
278
+ include Spell::QueryMethodsReturningAssociationRelation
279
+ Elem = type_member(fixed: Spell)
428
280
 
429
281
  sig { params(records: T.any(Spell, T::Array[Spell])).returns(T.self_type) }
430
282
  def <<(*records); end
@@ -8,8 +8,6 @@ module Spell::HABTM_SpellBooks::ActiveRelation_WhereNot
8
8
  end
9
9
 
10
10
  module Spell::HABTM_SpellBooks::GeneratedAttributeMethods
11
- extend T::Sig
12
-
13
11
  sig { returns(Integer) }
14
12
  def spell_book_id; end
15
13
 
@@ -30,17 +28,33 @@ module Spell::HABTM_SpellBooks::GeneratedAttributeMethods
30
28
  end
31
29
 
32
30
  module Spell::HABTM_SpellBooks::GeneratedAssociationMethods
33
- extend T::Sig
34
-
35
31
  sig { returns(T.nilable(::Spell)) }
36
32
  def left_side; end
37
33
 
34
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::Spell).void)).returns(::Spell) }
35
+ def build_left_side(*args, &block); end
36
+
37
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::Spell).void)).returns(::Spell) }
38
+ def create_left_side(*args, &block); end
39
+
40
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::Spell).void)).returns(::Spell) }
41
+ def create_left_side!(*args, &block); end
42
+
38
43
  sig { params(value: T.nilable(::Spell)).void }
39
44
  def left_side=(value); end
40
45
 
41
46
  sig { returns(::SpellBook) }
42
47
  def spell_book; end
43
48
 
49
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::SpellBook).void)).returns(::SpellBook) }
50
+ def build_spell_book(*args, &block); end
51
+
52
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::SpellBook).void)).returns(::SpellBook) }
53
+ def create_spell_book(*args, &block); end
54
+
55
+ sig { params(args: T.untyped, block: T.nilable(T.proc.params(object: ::SpellBook).void)).returns(::SpellBook) }
56
+ def create_spell_book!(*args, &block); end
57
+
44
58
  sig { params(value: ::SpellBook).void }
45
59
  def spell_book=(value); end
46
60
  end
@@ -66,102 +80,11 @@ class Spell::HABTM_SpellBooks < ActiveRecord::Base
66
80
  include Spell::HABTM_SpellBooks::GeneratedAttributeMethods
67
81
  include Spell::HABTM_SpellBooks::GeneratedAssociationMethods
68
82
  extend Spell::HABTM_SpellBooks::CustomFinderMethods
69
- extend T::Sig
70
- extend T::Generic
83
+ extend Spell::HABTM_SpellBooks::QueryMethodsReturningRelation
71
84
  RelationType = T.type_alias { T.any(Spell::HABTM_SpellBooks::ActiveRecord_Relation, Spell::HABTM_SpellBooks::ActiveRecord_Associations_CollectionProxy, Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
72
-
73
- sig { returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
74
- def self.all; end
75
-
76
- sig { params(block: T.nilable(T.proc.void)).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
77
- def self.unscoped(&block); end
78
-
79
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
80
- def self.select(*args); end
81
-
82
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
83
- def self.order(*args); end
84
-
85
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
86
- def self.reorder(*args); end
87
-
88
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
89
- def self.group(*args); end
90
-
91
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
92
- def self.limit(*args); end
93
-
94
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
95
- def self.offset(*args); end
96
-
97
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
98
- def self.joins(*args); end
99
-
100
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
101
- def self.left_joins(*args); end
102
-
103
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
104
- def self.left_outer_joins(*args); end
105
-
106
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
107
- def self.where(*args); end
108
-
109
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
110
- def self.rewhere(*args); end
111
-
112
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
113
- def self.preload(*args); end
114
-
115
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
116
- def self.eager_load(*args); end
117
-
118
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
119
- def self.includes(*args); end
120
-
121
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
122
- def self.from(*args); end
123
-
124
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
125
- def self.lock(*args); end
126
-
127
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
128
- def self.readonly(*args); end
129
-
130
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
131
- def self.or(*args); end
132
-
133
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
134
- def self.having(*args); end
135
-
136
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
137
- def self.create_with(*args); end
138
-
139
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
140
- def self.distinct(*args); end
141
-
142
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
143
- def self.references(*args); end
144
-
145
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
146
- def self.none(*args); end
147
-
148
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
149
- def self.unscope(*args); end
150
-
151
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
152
- def self.except(*args); end
153
-
154
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
155
- def self.extending(*args, &block); end
156
85
  end
157
86
 
158
- class Spell::HABTM_SpellBooks::ActiveRecord_Relation < ActiveRecord::Relation
159
- include Spell::HABTM_SpellBooks::ActiveRelation_WhereNot
160
- include Spell::HABTM_SpellBooks::CustomFinderMethods
161
- extend T::Sig
162
- extend T::Generic
163
- Elem = type_member(fixed: Spell::HABTM_SpellBooks)
164
-
87
+ module Spell::HABTM_SpellBooks::QueryMethodsReturningRelation
165
88
  sig { returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
166
89
  def all; end
167
90
 
@@ -245,19 +168,25 @@ class Spell::HABTM_SpellBooks::ActiveRecord_Relation < ActiveRecord::Relation
245
168
 
246
169
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
247
170
  def extending(*args, &block); end
248
- end
249
171
 
250
- class Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
251
- include Spell::HABTM_SpellBooks::ActiveRelation_WhereNot
252
- include Spell::HABTM_SpellBooks::CustomFinderMethods
253
- extend T::Sig
254
- extend T::Generic
255
- Elem = type_member(fixed: Spell::HABTM_SpellBooks)
172
+ sig do
173
+ params(
174
+ of: T.nilable(Integer),
175
+ start: T.nilable(Integer),
176
+ finish: T.nilable(Integer),
177
+ load: T.nilable(T::Boolean),
178
+ error_on_ignore: T.nilable(T::Boolean),
179
+ block: T.nilable(T.proc.params(e: Spell::HABTM_SpellBooks::ActiveRecord_Relation).void)
180
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
181
+ end
182
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
183
+ end
256
184
 
185
+ module Spell::HABTM_SpellBooks::QueryMethodsReturningAssociationRelation
257
186
  sig { returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
258
187
  def all; end
259
188
 
260
- sig { params(block: T.nilable(T.proc.void)).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
189
+ sig { params(block: T.nilable(T.proc.void)).returns(Spell::HABTM_SpellBooks::ActiveRecord_Relation) }
261
190
  def unscoped(&block); end
262
191
 
263
192
  sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
@@ -337,97 +266,38 @@ class Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation < ActiveRecord::
337
266
 
338
267
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
339
268
  def extending(*args, &block); end
269
+
270
+ sig do
271
+ params(
272
+ of: T.nilable(Integer),
273
+ start: T.nilable(Integer),
274
+ finish: T.nilable(Integer),
275
+ load: T.nilable(T::Boolean),
276
+ error_on_ignore: T.nilable(T::Boolean),
277
+ block: T.nilable(T.proc.params(e: Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation).void)
278
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
279
+ end
280
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
340
281
  end
341
282
 
342
- class Spell::HABTM_SpellBooks::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
283
+ class Spell::HABTM_SpellBooks::ActiveRecord_Relation < ActiveRecord::Relation
284
+ include Spell::HABTM_SpellBooks::ActiveRelation_WhereNot
343
285
  include Spell::HABTM_SpellBooks::CustomFinderMethods
344
- extend T::Sig
345
- extend T::Generic
286
+ include Spell::HABTM_SpellBooks::QueryMethodsReturningRelation
346
287
  Elem = type_member(fixed: Spell::HABTM_SpellBooks)
288
+ end
347
289
 
348
- sig { returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
349
- def all; end
350
-
351
- sig { params(block: T.nilable(T.proc.void)).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
352
- def unscoped(&block); end
353
-
354
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
355
- def select(*args); end
356
-
357
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
358
- def order(*args); end
359
-
360
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
361
- def reorder(*args); end
362
-
363
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
364
- def group(*args); end
365
-
366
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
367
- def limit(*args); end
368
-
369
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
370
- def offset(*args); end
371
-
372
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
373
- def joins(*args); end
374
-
375
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
376
- def left_joins(*args); end
377
-
378
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
379
- def left_outer_joins(*args); end
380
-
381
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
382
- def where(*args); end
383
-
384
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
385
- def rewhere(*args); end
386
-
387
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
388
- def preload(*args); end
389
-
390
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
391
- def eager_load(*args); end
392
-
393
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
394
- def includes(*args); end
395
-
396
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
397
- def from(*args); end
398
-
399
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
400
- def lock(*args); end
401
-
402
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
403
- def readonly(*args); end
404
-
405
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
406
- def or(*args); end
407
-
408
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
409
- def having(*args); end
410
-
411
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
412
- def create_with(*args); end
413
-
414
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
415
- def distinct(*args); end
416
-
417
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
418
- def references(*args); end
419
-
420
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
421
- def none(*args); end
422
-
423
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
424
- def unscope(*args); end
425
-
426
- sig { params(args: T.untyped).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
427
- def except(*args); end
290
+ class Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
291
+ include Spell::HABTM_SpellBooks::ActiveRelation_WhereNot
292
+ include Spell::HABTM_SpellBooks::CustomFinderMethods
293
+ include Spell::HABTM_SpellBooks::QueryMethodsReturningAssociationRelation
294
+ Elem = type_member(fixed: Spell::HABTM_SpellBooks)
295
+ end
428
296
 
429
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Spell::HABTM_SpellBooks::ActiveRecord_AssociationRelation) }
430
- def extending(*args, &block); end
297
+ class Spell::HABTM_SpellBooks::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
298
+ include Spell::HABTM_SpellBooks::CustomFinderMethods
299
+ include Spell::HABTM_SpellBooks::QueryMethodsReturningAssociationRelation
300
+ Elem = type_member(fixed: Spell::HABTM_SpellBooks)
431
301
 
432
302
  sig { params(records: T.any(Spell::HABTM_SpellBooks, T::Array[Spell::HABTM_SpellBooks])).returns(T.self_type) }
433
303
  def <<(*records); end