sorbet-rails 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +13 -1
  3. data/.travis.yml +2 -2
  4. data/Gemfile +1 -1
  5. data/README.md +79 -3
  6. data/lib/sorbet-rails.rb +5 -1
  7. data/lib/sorbet-rails/activerecord.rbi +27 -0
  8. data/lib/sorbet-rails/custom_finder_methods.rb +11 -0
  9. data/lib/sorbet-rails/helper_rbi_formatter.rb +33 -0
  10. data/lib/sorbet-rails/model_plugins/active_record_assoc.rb +91 -0
  11. data/lib/sorbet-rails/model_plugins/active_record_attribute.rb +111 -0
  12. data/lib/sorbet-rails/model_plugins/active_record_enum.rb +43 -0
  13. data/lib/sorbet-rails/model_plugins/active_record_finder_methods.rb +80 -0
  14. data/lib/sorbet-rails/model_plugins/active_record_named_scope.rb +28 -0
  15. data/lib/sorbet-rails/model_plugins/active_record_querying.rb +42 -0
  16. data/lib/sorbet-rails/model_plugins/active_relation_where_not.rb +28 -0
  17. data/lib/sorbet-rails/model_plugins/base.rb +33 -0
  18. data/lib/sorbet-rails/model_plugins/custom_finder_methods.rb +54 -0
  19. data/lib/sorbet-rails/model_plugins/enumerable_collections.rb +49 -0
  20. data/lib/sorbet-rails/model_plugins/plugins.rb +45 -0
  21. data/lib/sorbet-rails/model_rbi_formatter.rb +108 -362
  22. data/lib/sorbet-rails/model_utils.rb +45 -0
  23. data/lib/sorbet-rails/railtie.rb +1 -0
  24. data/lib/sorbet-rails/routes_rbi_formatter.rb +12 -3
  25. data/lib/sorbet-rails/tasks/rails_rbi.rake +36 -15
  26. data/lib/sorbet-rails/utils.rb +4 -0
  27. data/sorbet-rails.gemspec +4 -2
  28. data/spec/helper_rbi_formatter_spec.rb +13 -0
  29. data/spec/model_plugins_spec.rb +31 -0
  30. data/spec/model_rbi_formatter_spec.rb +5 -5
  31. data/spec/rake_rails_rbi_helpers_spec.rb +14 -0
  32. data/spec/routes_rbi_formatter_spec.rb +3 -3
  33. data/spec/sorbet_spec.rb +12 -16
  34. data/spec/support/rails_shared/app/controllers/application_controller.rb +1 -1
  35. data/spec/support/rails_shared/app/helpers/bar_helper.rb +2 -0
  36. data/spec/support/rails_shared/app/helpers/baz_helper.rb +2 -0
  37. data/spec/support/rails_shared/app/helpers/foo_helper.rb +2 -0
  38. data/spec/support/rails_shared/app/models/concerns/mythical.rb +10 -0
  39. data/spec/support/rails_shared/app/models/wand.rb +1 -0
  40. data/spec/support/rails_shared/config/initializers/sorbet_rails.rb +3 -0
  41. data/spec/support/rails_shared/lib/mythical_rbi_plugin.rb +16 -0
  42. data/spec/support/rails_shared/sorbet_test_cases.rb +5 -2
  43. data/spec/support/rails_shared/typed-override.yaml +2 -0
  44. data/spec/support/rails_symlinks/app/helpers +1 -0
  45. data/spec/support/rails_symlinks/config/initializers/sorbet_rails.rb +1 -0
  46. data/spec/support/rails_symlinks/lib/mythical_rbi_plugin.rb +1 -0
  47. data/spec/support/rails_symlinks/typed-override.yaml +1 -0
  48. data/spec/support/v4.2/Gemfile.lock +5 -0
  49. data/spec/support/v4.2/app/helpers +1 -0
  50. data/spec/support/v4.2/config/initializers/sorbet_rails.rb +1 -0
  51. data/spec/support/v4.2/config/routes.rb +0 -1
  52. data/spec/support/v4.2/lib/mythical_rbi_plugin.rb +1 -0
  53. data/spec/support/v4.2/sorbet/rbi/sorbet-typed/lib/activerecord/all/activerecord.rbi +1 -1
  54. data/spec/support/v4.2/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +1 -1
  55. data/spec/support/v4.2/typed-override.yaml +1 -0
  56. data/spec/support/v5.0/Gemfile.lock +5 -0
  57. data/spec/support/v5.0/app/helpers +1 -0
  58. data/spec/support/v5.0/config/initializers/sorbet_rails.rb +1 -0
  59. data/spec/support/v5.0/config/routes.rb +0 -1
  60. data/spec/support/v5.0/lib/mythical_rbi_plugin.rb +1 -0
  61. data/spec/support/v5.0/sorbet/rbi/sorbet-typed/lib/activerecord/all/activerecord.rbi +1 -1
  62. data/spec/support/v5.0/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +1 -1
  63. data/spec/support/v5.0/typed-override.yaml +1 -0
  64. data/spec/support/v5.1/Gemfile.lock +5 -0
  65. data/spec/support/v5.1/app/helpers +1 -0
  66. data/spec/support/v5.1/config/initializers/sorbet_rails.rb +1 -0
  67. data/spec/support/v5.1/lib/mythical_rbi_plugin.rb +1 -0
  68. data/spec/support/v5.1/sorbet/rbi/sorbet-typed/lib/activerecord/all/activerecord.rbi +1 -1
  69. data/spec/support/v5.1/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +1 -1
  70. data/spec/support/v5.1/typed-override.yaml +1 -0
  71. data/spec/support/v5.2-no-sorbet/Gemfile +0 -2
  72. data/spec/support/v5.2-no-sorbet/Gemfile.lock +7 -5
  73. data/spec/support/v5.2-no-sorbet/app/helpers +1 -0
  74. data/spec/support/v5.2-no-sorbet/config/initializers/sorbet_rails.rb +1 -0
  75. data/spec/support/v5.2-no-sorbet/lib/mythical_rbi_plugin.rb +1 -0
  76. data/spec/support/v5.2-no-sorbet/sorbet_test_cases.rb +1 -0
  77. data/spec/support/v5.2-no-sorbet/typed-override.yaml +1 -0
  78. data/spec/support/v5.2/Gemfile +0 -2
  79. data/spec/support/v5.2/Gemfile.lock +7 -5
  80. data/spec/support/v5.2/app/helpers +1 -0
  81. data/spec/support/v5.2/config/initializers/sorbet_rails.rb +1 -0
  82. data/spec/support/v5.2/lib/mythical_rbi_plugin.rb +1 -0
  83. data/spec/support/v5.2/sorbet/rbi/sorbet-typed/lib/activerecord/all/activerecord.rbi +1 -1
  84. data/spec/support/v5.2/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +1 -1
  85. data/spec/support/v5.2/typed-override.yaml +1 -0
  86. data/spec/support/v6.0/Gemfile +1 -3
  87. data/spec/support/v6.0/Gemfile.lock +61 -59
  88. data/spec/support/v6.0/app/helpers +1 -0
  89. data/spec/support/v6.0/config/initializers/sorbet_rails.rb +1 -0
  90. data/spec/support/v6.0/config/routes.rb +0 -1
  91. data/spec/support/v6.0/lib/mythical_rbi_plugin.rb +1 -0
  92. data/spec/support/v6.0/sorbet/rbi/sorbet-typed/lib/activerecord/all/activerecord.rbi +1 -1
  93. data/spec/support/v6.0/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +1 -1
  94. data/spec/support/v6.0/typed-override.yaml +1 -0
  95. data/spec/test_data/v4.2/expected_helpers.rbi +17 -0
  96. data/spec/test_data/v4.2/expected_potion.rbi +259 -28
  97. data/spec/test_data/v4.2/expected_spell_book.rbi +278 -37
  98. data/spec/test_data/v4.2/expected_srb_tc_output.txt +1 -99
  99. data/spec/test_data/v4.2/expected_wand.rbi +345 -96
  100. data/spec/test_data/v4.2/expected_wizard.rbi +322 -76
  101. data/spec/test_data/v4.2/expected_wizard_wo_spellbook.rbi +322 -76
  102. data/spec/test_data/v5.0/expected_helpers.rbi +17 -0
  103. data/spec/test_data/v5.0/expected_internal_metadata.rbi +273 -37
  104. data/spec/test_data/v5.0/expected_potion.rbi +259 -28
  105. data/spec/test_data/v5.0/expected_schema_migration.rbi +264 -28
  106. data/spec/test_data/v5.0/expected_spell_book.rbi +278 -37
  107. data/spec/test_data/v5.0/expected_srb_tc_output.txt +1 -81
  108. data/spec/test_data/v5.0/expected_wand.rbi +341 -92
  109. data/spec/test_data/v5.0/expected_wizard.rbi +318 -72
  110. data/spec/test_data/v5.0/expected_wizard_wo_spellbook.rbi +318 -72
  111. data/spec/test_data/v5.1/expected_helpers.rbi +17 -0
  112. data/spec/test_data/v5.1/expected_internal_metadata.rbi +273 -37
  113. data/spec/test_data/v5.1/expected_potion.rbi +259 -28
  114. data/spec/test_data/v5.1/expected_schema_migration.rbi +264 -28
  115. data/spec/test_data/v5.1/expected_spell_book.rbi +278 -37
  116. data/spec/test_data/v5.1/expected_srb_tc_output.txt +1 -81
  117. data/spec/test_data/v5.1/expected_wand.rbi +341 -92
  118. data/spec/test_data/v5.1/expected_wizard.rbi +318 -72
  119. data/spec/test_data/v5.1/expected_wizard_wo_spellbook.rbi +318 -72
  120. data/spec/test_data/v5.2-no-sorbet/expected_attachment.rbi +265 -29
  121. data/spec/test_data/v5.2-no-sorbet/expected_blob.rbi +271 -35
  122. data/spec/test_data/v5.2-no-sorbet/expected_helpers.rbi +17 -0
  123. data/spec/test_data/v5.2-no-sorbet/expected_internal_metadata.rbi +273 -37
  124. data/spec/test_data/v5.2-no-sorbet/expected_potion.rbi +259 -28
  125. data/spec/test_data/v5.2-no-sorbet/expected_schema_migration.rbi +264 -28
  126. data/spec/test_data/v5.2-no-sorbet/expected_spell_book.rbi +278 -37
  127. data/spec/test_data/v5.2-no-sorbet/expected_srb_tc_output.txt +1 -81
  128. data/spec/test_data/v5.2-no-sorbet/expected_wand.rbi +351 -102
  129. data/spec/test_data/v5.2-no-sorbet/expected_wizard.rbi +318 -72
  130. data/spec/test_data/v5.2-no-sorbet/expected_wizard_wo_spellbook.rbi +318 -72
  131. data/spec/test_data/v5.2/expected_attachment.rbi +265 -29
  132. data/spec/test_data/v5.2/expected_blob.rbi +271 -35
  133. data/spec/test_data/v5.2/expected_helpers.rbi +17 -0
  134. data/spec/test_data/v5.2/expected_internal_metadata.rbi +273 -37
  135. data/spec/test_data/v5.2/expected_potion.rbi +259 -28
  136. data/spec/test_data/v5.2/expected_schema_migration.rbi +264 -28
  137. data/spec/test_data/v5.2/expected_spell_book.rbi +278 -37
  138. data/spec/test_data/v5.2/expected_srb_tc_output.txt +1 -81
  139. data/spec/test_data/v5.2/expected_wand.rbi +351 -102
  140. data/spec/test_data/v5.2/expected_wizard.rbi +318 -72
  141. data/spec/test_data/v5.2/expected_wizard_wo_spellbook.rbi +318 -72
  142. data/spec/test_data/v6.0/expected_attachment.rbi +265 -29
  143. data/spec/test_data/v6.0/expected_blob.rbi +271 -35
  144. data/spec/test_data/v6.0/expected_helpers.rbi +17 -0
  145. data/spec/test_data/v6.0/expected_internal_metadata.rbi +273 -37
  146. data/spec/test_data/v6.0/expected_potion.rbi +259 -28
  147. data/spec/test_data/v6.0/expected_schema_migration.rbi +264 -28
  148. data/spec/test_data/v6.0/expected_spell_book.rbi +278 -37
  149. data/spec/test_data/v6.0/expected_srb_tc_output.txt +1 -81
  150. data/spec/test_data/v6.0/expected_wand.rbi +351 -102
  151. data/spec/test_data/v6.0/expected_wizard.rbi +318 -72
  152. data/spec/test_data/v6.0/expected_wizard_wo_spellbook.rbi +318 -72
  153. metadata +120 -37
  154. data/lib/sorbet-rails/rbi/activerecord.rbi +0 -207
  155. data/spec/support/v4.2/app/helpers/application_helper.rb +0 -3
  156. data/spec/support/v4.2/sorbet/rbi/gems/sorbet-runtime.rbi +0 -647
  157. data/spec/support/v4.2/sorbet/rbi/hidden-definitions/errors.txt +0 -11998
  158. data/spec/support/v4.2/sorbet/rbi/hidden-definitions/hidden.rbi +0 -27774
  159. data/spec/support/v5.0/sorbet/rbi/gems/sorbet-runtime.rbi +0 -647
  160. data/spec/support/v5.0/sorbet/rbi/hidden-definitions/errors.txt +0 -10523
  161. data/spec/support/v5.0/sorbet/rbi/hidden-definitions/hidden.rbi +0 -24969
  162. data/spec/support/v5.1/sorbet/rbi/gems/sorbet-runtime.rbi +0 -647
  163. data/spec/support/v5.1/sorbet/rbi/hidden-definitions/errors.txt +0 -10226
  164. data/spec/support/v5.1/sorbet/rbi/hidden-definitions/hidden.rbi +0 -24635
  165. data/spec/support/v5.2/.ruby-version +0 -1
  166. data/spec/support/v5.2/sorbet/rbi/gems/sorbet-runtime.rbi +0 -644
  167. data/spec/support/v5.2/sorbet/rbi/hidden-definitions/errors.txt +0 -10046
  168. data/spec/support/v5.2/sorbet/rbi/hidden-definitions/hidden.rbi +0 -24424
  169. data/spec/support/v6.0/sorbet/rbi/gems/sorbet-runtime.rbi +0 -647
  170. data/spec/support/v6.0/sorbet/rbi/hidden-definitions/errors.txt +0 -12074
  171. data/spec/support/v6.0/sorbet/rbi/hidden-definitions/hidden.rbi +0 -28231
@@ -1,51 +1,47 @@
1
1
  # This is an autogenerated file for dynamic methods in ActiveRecord::SchemaMigration
2
- # Please rerun rake rails_rbi:models to regenerate.
3
- # typed: strong
4
-
5
- class ActiveRecord::SchemaMigration::ActiveRecord_Relation < ActiveRecord::Relation
6
- include ActiveRecord::SchemaMigration::ModelRelationShared
7
- extend T::Generic
8
- Elem = type_member(fixed: ActiveRecord::SchemaMigration)
9
- end
10
-
11
- class ActiveRecord::SchemaMigration::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
12
- include ActiveRecord::SchemaMigration::ModelRelationShared
13
- extend T::Generic
14
- Elem = type_member(fixed: ActiveRecord::SchemaMigration)
15
- end
2
+ # Please rerun rake rails_rbi:models[ActiveRecord::SchemaMigration] to regenerate.
16
3
 
17
- class ActiveRecord::SchemaMigration < ActiveRecord::Base
18
- extend T::Sig
19
- extend T::Generic
20
- extend ActiveRecord::SchemaMigration::ModelRelationShared
21
- include ActiveRecord::SchemaMigration::InstanceMethods
22
- Elem = type_template(fixed: ActiveRecord::SchemaMigration)
4
+ # typed: strong
5
+ module ActiveRecord::SchemaMigration::ActiveRelation_WhereNot
6
+ sig { params(opts: T.untyped, rest: T.untyped).returns(T.self_type) }
7
+ def not(opts, *rest); end
23
8
  end
24
9
 
25
- module ActiveRecord::SchemaMigration::InstanceMethods
10
+ module ActiveRecord::SchemaMigration::GeneratedAttributeMethods
26
11
  extend T::Sig
27
12
 
28
13
  sig { returns(String) }
29
- def version(); end
14
+ def version; end
30
15
 
31
16
  sig { params(value: String).void }
32
17
  def version=(value); end
33
18
 
34
- sig { params(args: T.untyped).returns(T::Boolean) }
35
- def version?(*args); end
36
-
19
+ sig { returns(T::Boolean) }
20
+ def version?; end
37
21
  end
38
22
 
39
- class ActiveRecord::SchemaMigration
40
- extend T::Sig
23
+ module ActiveRecord::SchemaMigration::CustomFinderMethods
24
+ sig { params(limit: Integer).returns(T::Array[ActiveRecord::SchemaMigration]) }
25
+ def first_n(limit); end
26
+
27
+ sig { params(limit: Integer).returns(T::Array[ActiveRecord::SchemaMigration]) }
28
+ def last_n(limit); end
29
+
30
+ sig { params(args: T::Array[T.any(Integer, String)]).returns(T::Array[ActiveRecord::SchemaMigration]) }
31
+ def find_n(*args); end
32
+
33
+ sig { params(id: Integer).returns(T.nilable(ActiveRecord::SchemaMigration)) }
34
+ def find_by_id(id); end
41
35
 
36
+ sig { params(id: Integer).returns(ActiveRecord::SchemaMigration) }
37
+ def find_by_id!(id); end
42
38
  end
43
39
 
44
40
  module ActiveRecord::SchemaMigration::ModelRelationShared
45
41
  extend T::Sig
46
42
 
47
43
  sig { returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
48
- def all(); end
44
+ def all; end
49
45
 
50
46
  sig { params(block: T.nilable(T.proc.void)).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
51
47
  def unscoped(&block); end
@@ -124,5 +120,245 @@ module ActiveRecord::SchemaMigration::ModelRelationShared
124
120
 
125
121
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
126
122
  def except(*args, &block); end
123
+ end
124
+
125
+ class ActiveRecord::SchemaMigration::ActiveRecord_Relation < ActiveRecord::Relation
126
+ include ActiveRecord::SchemaMigration::ActiveRelation_WhereNot
127
+ include SorbetRails::CustomFinderMethods
128
+ include ActiveRecord::SchemaMigration::CustomFinderMethods
129
+ include Enumerable
130
+ include ActiveRecord::SchemaMigration::ModelRelationShared
131
+ extend T::Sig
132
+ extend T::Generic
133
+ Elem = type_member(fixed: ActiveRecord::SchemaMigration)
134
+
135
+ sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration) }
136
+ def find(*args); end
127
137
 
138
+ sig { params(args: T.untyped).returns(T.nilable(ActiveRecord::SchemaMigration)) }
139
+ def find_by(*args); end
140
+
141
+ sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration) }
142
+ def find_by!(*args); end
143
+
144
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
145
+ def first; end
146
+
147
+ sig { returns(ActiveRecord::SchemaMigration) }
148
+ def first!; end
149
+
150
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
151
+ def second; end
152
+
153
+ sig { returns(ActiveRecord::SchemaMigration) }
154
+ def second!; end
155
+
156
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
157
+ def third; end
158
+
159
+ sig { returns(ActiveRecord::SchemaMigration) }
160
+ def third!; end
161
+
162
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
163
+ def third_to_last; end
164
+
165
+ sig { returns(ActiveRecord::SchemaMigration) }
166
+ def third_to_last!; end
167
+
168
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
169
+ def second_to_last; end
170
+
171
+ sig { returns(ActiveRecord::SchemaMigration) }
172
+ def second_to_last!; end
173
+
174
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
175
+ def last; end
176
+
177
+ sig { returns(ActiveRecord::SchemaMigration) }
178
+ def last!; end
179
+
180
+ sig { params(conditions: T.untyped).returns(T::Boolean) }
181
+ def exists?(conditions = nil); end
182
+
183
+ sig { params(args: T.untyped).returns(T::Boolean) }
184
+ def any?(*args); end
185
+
186
+ sig { params(args: T.untyped).returns(T::Boolean) }
187
+ def many?(*args); end
188
+
189
+ sig { params(args: T.untyped).returns(T::Boolean) }
190
+ def none?(*args); end
191
+
192
+ sig { params(args: T.untyped).returns(T::Boolean) }
193
+ def one?(*args); end
194
+
195
+ sig { implementation.params(block: T.proc.params(e: ActiveRecord::SchemaMigration).void).void }
196
+ def each(&block); end
197
+
198
+ sig { params(level: T.nilable(Integer)).returns(T::Array[ActiveRecord::SchemaMigration]) }
199
+ def flatten(level); end
200
+
201
+ sig { returns(T::Array[ActiveRecord::SchemaMigration]) }
202
+ def to_a; end
203
+ end
204
+
205
+ class ActiveRecord::SchemaMigration::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
206
+ include ActiveRecord::SchemaMigration::ActiveRelation_WhereNot
207
+ include SorbetRails::CustomFinderMethods
208
+ include ActiveRecord::SchemaMigration::CustomFinderMethods
209
+ include Enumerable
210
+ include ActiveRecord::SchemaMigration::ModelRelationShared
211
+ extend T::Sig
212
+ extend T::Generic
213
+ Elem = type_member(fixed: ActiveRecord::SchemaMigration)
214
+
215
+ sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration) }
216
+ def find(*args); end
217
+
218
+ sig { params(args: T.untyped).returns(T.nilable(ActiveRecord::SchemaMigration)) }
219
+ def find_by(*args); end
220
+
221
+ sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration) }
222
+ def find_by!(*args); end
223
+
224
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
225
+ def first; end
226
+
227
+ sig { returns(ActiveRecord::SchemaMigration) }
228
+ def first!; end
229
+
230
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
231
+ def second; end
232
+
233
+ sig { returns(ActiveRecord::SchemaMigration) }
234
+ def second!; end
235
+
236
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
237
+ def third; end
238
+
239
+ sig { returns(ActiveRecord::SchemaMigration) }
240
+ def third!; end
241
+
242
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
243
+ def third_to_last; end
244
+
245
+ sig { returns(ActiveRecord::SchemaMigration) }
246
+ def third_to_last!; end
247
+
248
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
249
+ def second_to_last; end
250
+
251
+ sig { returns(ActiveRecord::SchemaMigration) }
252
+ def second_to_last!; end
253
+
254
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
255
+ def last; end
256
+
257
+ sig { returns(ActiveRecord::SchemaMigration) }
258
+ def last!; end
259
+
260
+ sig { params(conditions: T.untyped).returns(T::Boolean) }
261
+ def exists?(conditions = nil); end
262
+
263
+ sig { params(args: T.untyped).returns(T::Boolean) }
264
+ def any?(*args); end
265
+
266
+ sig { params(args: T.untyped).returns(T::Boolean) }
267
+ def many?(*args); end
268
+
269
+ sig { params(args: T.untyped).returns(T::Boolean) }
270
+ def none?(*args); end
271
+
272
+ sig { params(args: T.untyped).returns(T::Boolean) }
273
+ def one?(*args); end
274
+
275
+ sig { implementation.params(block: T.proc.params(e: ActiveRecord::SchemaMigration).void).void }
276
+ def each(&block); end
277
+
278
+ sig { params(level: T.nilable(Integer)).returns(T::Array[ActiveRecord::SchemaMigration]) }
279
+ def flatten(level); end
280
+
281
+ sig { returns(T::Array[ActiveRecord::SchemaMigration]) }
282
+ def to_a; end
283
+
284
+ sig { params(records: T.any(ActiveRecord::SchemaMigration, T::Array[ActiveRecord::SchemaMigration])).returns(T.self_type) }
285
+ def <<(*records); end
286
+
287
+ sig { params(records: T.any(ActiveRecord::SchemaMigration, T::Array[ActiveRecord::SchemaMigration])).returns(T.self_type) }
288
+ def append(*records); end
289
+
290
+ sig { params(records: T.any(ActiveRecord::SchemaMigration, T::Array[ActiveRecord::SchemaMigration])).returns(T.self_type) }
291
+ def push(*records); end
292
+
293
+ sig { params(records: T.any(ActiveRecord::SchemaMigration, T::Array[ActiveRecord::SchemaMigration])).returns(T.self_type) }
294
+ def concat(*records); end
295
+ end
296
+
297
+ class ActiveRecord::SchemaMigration < ActiveRecord::Base
298
+ include ActiveRecord::SchemaMigration::GeneratedAttributeMethods
299
+ extend SorbetRails::CustomFinderMethods
300
+ extend ActiveRecord::SchemaMigration::CustomFinderMethods
301
+ extend T::Sig
302
+ extend T::Generic
303
+ extend ActiveRecord::SchemaMigration::ModelRelationShared
304
+
305
+ sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration) }
306
+ def self.find(*args); end
307
+
308
+ sig { params(args: T.untyped).returns(T.nilable(ActiveRecord::SchemaMigration)) }
309
+ def self.find_by(*args); end
310
+
311
+ sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration) }
312
+ def self.find_by!(*args); end
313
+
314
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
315
+ def self.first; end
316
+
317
+ sig { returns(ActiveRecord::SchemaMigration) }
318
+ def self.first!; end
319
+
320
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
321
+ def self.second; end
322
+
323
+ sig { returns(ActiveRecord::SchemaMigration) }
324
+ def self.second!; end
325
+
326
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
327
+ def self.third; end
328
+
329
+ sig { returns(ActiveRecord::SchemaMigration) }
330
+ def self.third!; end
331
+
332
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
333
+ def self.third_to_last; end
334
+
335
+ sig { returns(ActiveRecord::SchemaMigration) }
336
+ def self.third_to_last!; end
337
+
338
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
339
+ def self.second_to_last; end
340
+
341
+ sig { returns(ActiveRecord::SchemaMigration) }
342
+ def self.second_to_last!; end
343
+
344
+ sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
345
+ def self.last; end
346
+
347
+ sig { returns(ActiveRecord::SchemaMigration) }
348
+ def self.last!; end
349
+
350
+ sig { params(conditions: T.untyped).returns(T::Boolean) }
351
+ def self.exists?(conditions = nil); end
352
+
353
+ sig { params(args: T.untyped).returns(T::Boolean) }
354
+ def self.any?(*args); end
355
+
356
+ sig { params(args: T.untyped).returns(T::Boolean) }
357
+ def self.many?(*args); end
358
+
359
+ sig { params(args: T.untyped).returns(T::Boolean) }
360
+ def self.none?(*args); end
361
+
362
+ sig { params(args: T.untyped).returns(T::Boolean) }
363
+ def self.one?(*args); end
128
364
  end
@@ -1,82 +1,82 @@
1
1
  # This is an autogenerated file for dynamic methods in SpellBook
2
- # Please rerun rake rails_rbi:models to regenerate.
3
- # typed: strong
2
+ # Please rerun rake rails_rbi:models[SpellBook] to regenerate.
4
3
 
5
- class SpellBook::ActiveRecord_Relation < ActiveRecord::Relation
6
- include SpellBook::ModelRelationShared
7
- extend T::Generic
8
- Elem = type_member(fixed: SpellBook)
9
- end
10
-
11
- class SpellBook::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
12
- include SpellBook::ModelRelationShared
13
- extend T::Generic
14
- Elem = type_member(fixed: SpellBook)
15
- end
16
-
17
- class SpellBook < ApplicationRecord
18
- extend T::Sig
19
- extend T::Generic
20
- extend SpellBook::ModelRelationShared
21
- include SpellBook::InstanceMethods
22
- Elem = type_template(fixed: SpellBook)
4
+ # typed: strong
5
+ module SpellBook::ActiveRelation_WhereNot
6
+ sig { params(opts: T.untyped, rest: T.untyped).returns(T.self_type) }
7
+ def not(opts, *rest); end
23
8
  end
24
9
 
25
- module SpellBook::InstanceMethods
10
+ module SpellBook::GeneratedAttributeMethods
26
11
  extend T::Sig
27
12
 
28
13
  sig { returns(Integer) }
29
- def id(); end
14
+ def id; end
30
15
 
31
16
  sig { params(value: Integer).void }
32
17
  def id=(value); end
33
18
 
34
- sig { params(args: T.untyped).returns(T::Boolean) }
35
- def id?(*args); end
19
+ sig { returns(T::Boolean) }
20
+ def id?; end
36
21
 
37
22
  sig { returns(T.nilable(String)) }
38
- def name(); end
23
+ def name; end
39
24
 
40
25
  sig { params(value: T.nilable(String)).void }
41
26
  def name=(value); end
42
27
 
43
- sig { params(args: T.untyped).returns(T::Boolean) }
44
- def name?(*args); end
28
+ sig { returns(T::Boolean) }
29
+ def name?; end
45
30
 
46
31
  sig { returns(T.nilable(Integer)) }
47
- def wizard_id(); end
32
+ def wizard_id; end
48
33
 
49
34
  sig { params(value: T.nilable(Integer)).void }
50
35
  def wizard_id=(value); end
51
36
 
52
- sig { params(args: T.untyped).returns(T::Boolean) }
53
- def wizard_id?(*args); end
54
-
37
+ sig { returns(T::Boolean) }
38
+ def wizard_id?; end
55
39
  end
56
40
 
57
- class SpellBook
41
+ module SpellBook::GeneratedAssociationMethods
58
42
  extend T::Sig
59
43
 
60
44
  sig { returns(T.nilable(::Wizard)) }
61
- def wizard(); end
45
+ def wizard; end
62
46
 
63
47
  sig { params(value: T.nilable(::Wizard)).void }
64
48
  def wizard=(value); end
49
+ end
50
+
51
+ module SpellBook::CustomFinderMethods
52
+ sig { params(limit: Integer).returns(T::Array[SpellBook]) }
53
+ def first_n(limit); end
54
+
55
+ sig { params(limit: Integer).returns(T::Array[SpellBook]) }
56
+ def last_n(limit); end
57
+
58
+ sig { params(args: T::Array[T.any(Integer, String)]).returns(T::Array[SpellBook]) }
59
+ def find_n(*args); end
65
60
 
61
+ sig { params(id: Integer).returns(T.nilable(SpellBook)) }
62
+ def find_by_id(id); end
63
+
64
+ sig { params(id: Integer).returns(SpellBook) }
65
+ def find_by_id!(id); end
66
66
  end
67
67
 
68
68
  module SpellBook::ModelRelationShared
69
69
  extend T::Sig
70
70
 
71
+ sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
72
+ def recent(*args); end
73
+
71
74
  sig { returns(SpellBook::ActiveRecord_Relation) }
72
- def all(); end
75
+ def all; end
73
76
 
74
77
  sig { params(block: T.nilable(T.proc.void)).returns(SpellBook::ActiveRecord_Relation) }
75
78
  def unscoped(&block); end
76
79
 
77
- sig { params(args: T.untyped).returns(SpellBook::ActiveRecord_Relation) }
78
- def recent(*args); end
79
-
80
80
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(SpellBook::ActiveRecord_Relation) }
81
81
  def select(*args, &block); end
82
82
 
@@ -151,5 +151,246 @@ module SpellBook::ModelRelationShared
151
151
 
152
152
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(SpellBook::ActiveRecord_Relation) }
153
153
  def except(*args, &block); end
154
+ end
155
+
156
+ class SpellBook::ActiveRecord_Relation < ActiveRecord::Relation
157
+ include SpellBook::ActiveRelation_WhereNot
158
+ include SorbetRails::CustomFinderMethods
159
+ include SpellBook::CustomFinderMethods
160
+ include Enumerable
161
+ include SpellBook::ModelRelationShared
162
+ extend T::Sig
163
+ extend T::Generic
164
+ Elem = type_member(fixed: SpellBook)
165
+
166
+ sig { params(args: T.untyped).returns(SpellBook) }
167
+ def find(*args); end
168
+
169
+ sig { params(args: T.untyped).returns(T.nilable(SpellBook)) }
170
+ def find_by(*args); end
171
+
172
+ sig { params(args: T.untyped).returns(SpellBook) }
173
+ def find_by!(*args); end
174
+
175
+ sig { returns(T.nilable(SpellBook)) }
176
+ def first; end
177
+
178
+ sig { returns(SpellBook) }
179
+ def first!; end
180
+
181
+ sig { returns(T.nilable(SpellBook)) }
182
+ def second; end
183
+
184
+ sig { returns(SpellBook) }
185
+ def second!; end
186
+
187
+ sig { returns(T.nilable(SpellBook)) }
188
+ def third; end
189
+
190
+ sig { returns(SpellBook) }
191
+ def third!; end
192
+
193
+ sig { returns(T.nilable(SpellBook)) }
194
+ def third_to_last; end
195
+
196
+ sig { returns(SpellBook) }
197
+ def third_to_last!; end
198
+
199
+ sig { returns(T.nilable(SpellBook)) }
200
+ def second_to_last; end
201
+
202
+ sig { returns(SpellBook) }
203
+ def second_to_last!; end
204
+
205
+ sig { returns(T.nilable(SpellBook)) }
206
+ def last; end
207
+
208
+ sig { returns(SpellBook) }
209
+ def last!; end
210
+
211
+ sig { params(conditions: T.untyped).returns(T::Boolean) }
212
+ def exists?(conditions = nil); end
213
+
214
+ sig { params(args: T.untyped).returns(T::Boolean) }
215
+ def any?(*args); end
216
+
217
+ sig { params(args: T.untyped).returns(T::Boolean) }
218
+ def many?(*args); end
219
+
220
+ sig { params(args: T.untyped).returns(T::Boolean) }
221
+ def none?(*args); end
222
+
223
+ sig { params(args: T.untyped).returns(T::Boolean) }
224
+ def one?(*args); end
225
+
226
+ sig { implementation.params(block: T.proc.params(e: SpellBook).void).void }
227
+ def each(&block); end
228
+
229
+ sig { params(level: T.nilable(Integer)).returns(T::Array[SpellBook]) }
230
+ def flatten(level); end
231
+
232
+ sig { returns(T::Array[SpellBook]) }
233
+ def to_a; end
234
+ end
235
+
236
+ class SpellBook::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
237
+ include SpellBook::ActiveRelation_WhereNot
238
+ include SorbetRails::CustomFinderMethods
239
+ include SpellBook::CustomFinderMethods
240
+ include Enumerable
241
+ include SpellBook::ModelRelationShared
242
+ extend T::Sig
243
+ extend T::Generic
244
+ Elem = type_member(fixed: SpellBook)
245
+
246
+ sig { params(args: T.untyped).returns(SpellBook) }
247
+ def find(*args); end
248
+
249
+ sig { params(args: T.untyped).returns(T.nilable(SpellBook)) }
250
+ def find_by(*args); end
251
+
252
+ sig { params(args: T.untyped).returns(SpellBook) }
253
+ def find_by!(*args); end
254
+
255
+ sig { returns(T.nilable(SpellBook)) }
256
+ def first; end
257
+
258
+ sig { returns(SpellBook) }
259
+ def first!; end
260
+
261
+ sig { returns(T.nilable(SpellBook)) }
262
+ def second; end
263
+
264
+ sig { returns(SpellBook) }
265
+ def second!; end
266
+
267
+ sig { returns(T.nilable(SpellBook)) }
268
+ def third; end
269
+
270
+ sig { returns(SpellBook) }
271
+ def third!; end
272
+
273
+ sig { returns(T.nilable(SpellBook)) }
274
+ def third_to_last; end
275
+
276
+ sig { returns(SpellBook) }
277
+ def third_to_last!; end
278
+
279
+ sig { returns(T.nilable(SpellBook)) }
280
+ def second_to_last; end
281
+
282
+ sig { returns(SpellBook) }
283
+ def second_to_last!; end
284
+
285
+ sig { returns(T.nilable(SpellBook)) }
286
+ def last; end
287
+
288
+ sig { returns(SpellBook) }
289
+ def last!; end
290
+
291
+ sig { params(conditions: T.untyped).returns(T::Boolean) }
292
+ def exists?(conditions = nil); end
293
+
294
+ sig { params(args: T.untyped).returns(T::Boolean) }
295
+ def any?(*args); end
296
+
297
+ sig { params(args: T.untyped).returns(T::Boolean) }
298
+ def many?(*args); end
299
+
300
+ sig { params(args: T.untyped).returns(T::Boolean) }
301
+ def none?(*args); end
302
+
303
+ sig { params(args: T.untyped).returns(T::Boolean) }
304
+ def one?(*args); end
305
+
306
+ sig { implementation.params(block: T.proc.params(e: SpellBook).void).void }
307
+ def each(&block); end
308
+
309
+ sig { params(level: T.nilable(Integer)).returns(T::Array[SpellBook]) }
310
+ def flatten(level); end
311
+
312
+ sig { returns(T::Array[SpellBook]) }
313
+ def to_a; end
154
314
 
315
+ sig { params(records: T.any(SpellBook, T::Array[SpellBook])).returns(T.self_type) }
316
+ def <<(*records); end
317
+
318
+ sig { params(records: T.any(SpellBook, T::Array[SpellBook])).returns(T.self_type) }
319
+ def append(*records); end
320
+
321
+ sig { params(records: T.any(SpellBook, T::Array[SpellBook])).returns(T.self_type) }
322
+ def push(*records); end
323
+
324
+ sig { params(records: T.any(SpellBook, T::Array[SpellBook])).returns(T.self_type) }
325
+ def concat(*records); end
326
+ end
327
+
328
+ class SpellBook < ApplicationRecord
329
+ include SpellBook::GeneratedAttributeMethods
330
+ include SpellBook::GeneratedAssociationMethods
331
+ extend SorbetRails::CustomFinderMethods
332
+ extend SpellBook::CustomFinderMethods
333
+ extend T::Sig
334
+ extend T::Generic
335
+ extend SpellBook::ModelRelationShared
336
+
337
+ sig { params(args: T.untyped).returns(SpellBook) }
338
+ def self.find(*args); end
339
+
340
+ sig { params(args: T.untyped).returns(T.nilable(SpellBook)) }
341
+ def self.find_by(*args); end
342
+
343
+ sig { params(args: T.untyped).returns(SpellBook) }
344
+ def self.find_by!(*args); end
345
+
346
+ sig { returns(T.nilable(SpellBook)) }
347
+ def self.first; end
348
+
349
+ sig { returns(SpellBook) }
350
+ def self.first!; end
351
+
352
+ sig { returns(T.nilable(SpellBook)) }
353
+ def self.second; end
354
+
355
+ sig { returns(SpellBook) }
356
+ def self.second!; end
357
+
358
+ sig { returns(T.nilable(SpellBook)) }
359
+ def self.third; end
360
+
361
+ sig { returns(SpellBook) }
362
+ def self.third!; end
363
+
364
+ sig { returns(T.nilable(SpellBook)) }
365
+ def self.third_to_last; end
366
+
367
+ sig { returns(SpellBook) }
368
+ def self.third_to_last!; end
369
+
370
+ sig { returns(T.nilable(SpellBook)) }
371
+ def self.second_to_last; end
372
+
373
+ sig { returns(SpellBook) }
374
+ def self.second_to_last!; end
375
+
376
+ sig { returns(T.nilable(SpellBook)) }
377
+ def self.last; end
378
+
379
+ sig { returns(SpellBook) }
380
+ def self.last!; end
381
+
382
+ sig { params(conditions: T.untyped).returns(T::Boolean) }
383
+ def self.exists?(conditions = nil); end
384
+
385
+ sig { params(args: T.untyped).returns(T::Boolean) }
386
+ def self.any?(*args); end
387
+
388
+ sig { params(args: T.untyped).returns(T::Boolean) }
389
+ def self.many?(*args); end
390
+
391
+ sig { params(args: T.untyped).returns(T::Boolean) }
392
+ def self.none?(*args); end
393
+
394
+ sig { params(args: T.untyped).returns(T::Boolean) }
395
+ def self.one?(*args); end
155
396
  end