sorbet-rails 0.5.9.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +4 -0
  3. data/.travis.yml +3 -3
  4. data/README.md +129 -52
  5. data/lib/bundled_rbi/active_record_base.rbi +83 -0
  6. data/lib/bundled_rbi/active_record_relation.rbi +43 -0
  7. data/lib/bundled_rbi/pluck_to_tstruct.rbi +0 -1
  8. data/lib/bundled_rbi/typed_params.rbi +9 -0
  9. data/lib/sorbet-rails.rb +1 -0
  10. data/lib/sorbet-rails/config.rb +0 -1
  11. data/lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb +1 -1
  12. data/lib/sorbet-rails/gem_plugins/friendly_id_plugin.rb +1 -1
  13. data/lib/sorbet-rails/model_plugins/active_record_assoc.rb +3 -3
  14. data/lib/sorbet-rails/model_plugins/active_record_attribute.rb +85 -17
  15. data/lib/sorbet-rails/model_plugins/active_record_enum.rb +0 -2
  16. data/lib/sorbet-rails/model_plugins/active_record_finder_methods.rb +49 -12
  17. data/lib/sorbet-rails/model_plugins/active_record_querying.rb +1 -1
  18. data/lib/sorbet-rails/model_plugins/active_storage_methods.rb +1 -1
  19. data/lib/sorbet-rails/model_plugins/plugins.rb +0 -3
  20. data/lib/sorbet-rails/rails_mixins/active_record_overrides.rb +156 -5
  21. data/lib/sorbet-rails/rails_mixins/generated_url_helpers.rb +16 -0
  22. data/lib/sorbet-rails/railtie.rb +2 -1
  23. data/lib/sorbet-rails/tasks/rails_rbi.rake +2 -0
  24. data/lib/sorbet-rails/type_assert/actionpack.rbi +4 -0
  25. data/lib/sorbet-rails/type_assert/type_assert.rb +1 -1
  26. data/lib/sorbet-rails/typed_params.rb +22 -0
  27. data/lib/sorbet-rails/utils.rb +5 -0
  28. data/sorbet-rails.gemspec +5 -3
  29. data/spec/generators/rails-template.rb +7 -3
  30. data/spec/generators/sorbet_test_cases.rb +46 -1
  31. data/spec/sorbet_spec.rb +3 -1
  32. data/spec/support/v5.0/Gemfile.lock +36 -23
  33. data/spec/support/v5.0/app/models/wizard.rb +6 -3
  34. data/spec/support/v5.0/db/migrate/20190620000001_create_wizards.rb +1 -0
  35. data/spec/support/v5.0/db/schema.rb +1 -0
  36. data/spec/support/v5.0/sorbet_test_cases.rb +46 -1
  37. data/spec/support/v5.1/Gemfile.lock +37 -24
  38. data/spec/support/v5.1/app/models/wizard.rb +6 -3
  39. data/spec/support/v5.1/db/migrate/20190620000001_create_wizards.rb +1 -0
  40. data/spec/support/v5.1/db/schema.rb +1 -0
  41. data/spec/support/v5.1/sorbet_test_cases.rb +46 -1
  42. data/spec/support/v5.2/Gemfile.lock +75 -62
  43. data/spec/support/v5.2/app/models/wizard.rb +6 -3
  44. data/spec/support/v5.2/db/migrate/20190620000001_create_wizards.rb +1 -0
  45. data/spec/support/v5.2/db/schema.rb +1 -0
  46. data/spec/support/v5.2/sorbet_test_cases.rb +46 -1
  47. data/spec/support/v6.0/Gemfile.lock +89 -76
  48. data/spec/support/v6.0/app/models/wizard.rb +6 -3
  49. data/spec/support/v6.0/db/migrate/20190620000001_create_wizards.rb +1 -0
  50. data/spec/support/v6.0/db/schema.rb +1 -0
  51. data/spec/support/v6.0/sorbet_test_cases.rb +46 -1
  52. data/spec/test_data/v5.0/expected_internal_metadata.rbi +33 -54
  53. data/spec/test_data/v5.0/expected_potion.rbi +33 -54
  54. data/spec/test_data/v5.0/expected_robe.rbi +33 -54
  55. data/spec/test_data/v5.0/expected_schema_migration.rbi +33 -54
  56. data/spec/test_data/v5.0/expected_school.rbi +33 -54
  57. data/spec/test_data/v5.0/expected_spell_book.rbi +46 -52
  58. data/spec/test_data/v5.0/expected_squib.rbi +42 -54
  59. data/spec/test_data/v5.0/expected_wand.rbi +47 -52
  60. data/spec/test_data/v5.0/expected_wizard.rbi +119 -56
  61. data/spec/test_data/v5.0/expected_wizard_wo_spellbook.rbi +119 -56
  62. data/spec/test_data/v5.1/expected_internal_metadata.rbi +33 -54
  63. data/spec/test_data/v5.1/expected_potion.rbi +33 -54
  64. data/spec/test_data/v5.1/expected_robe.rbi +33 -54
  65. data/spec/test_data/v5.1/expected_schema_migration.rbi +33 -54
  66. data/spec/test_data/v5.1/expected_school.rbi +33 -54
  67. data/spec/test_data/v5.1/expected_spell_book.rbi +46 -52
  68. data/spec/test_data/v5.1/expected_squib.rbi +42 -54
  69. data/spec/test_data/v5.1/expected_wand.rbi +47 -52
  70. data/spec/test_data/v5.1/expected_wizard.rbi +119 -56
  71. data/spec/test_data/v5.1/expected_wizard_wo_spellbook.rbi +119 -56
  72. data/spec/test_data/v5.2/expected_attachment.rbi +33 -54
  73. data/spec/test_data/v5.2/expected_blob.rbi +33 -54
  74. data/spec/test_data/v5.2/expected_internal_metadata.rbi +33 -54
  75. data/spec/test_data/v5.2/expected_potion.rbi +33 -54
  76. data/spec/test_data/v5.2/expected_robe.rbi +33 -54
  77. data/spec/test_data/v5.2/expected_schema_migration.rbi +33 -54
  78. data/spec/test_data/v5.2/expected_school.rbi +33 -54
  79. data/spec/test_data/v5.2/expected_spell_book.rbi +46 -52
  80. data/spec/test_data/v5.2/expected_squib.rbi +42 -54
  81. data/spec/test_data/v5.2/expected_wand.rbi +47 -52
  82. data/spec/test_data/v5.2/expected_wizard.rbi +119 -56
  83. data/spec/test_data/v5.2/expected_wizard_wo_spellbook.rbi +119 -56
  84. data/spec/test_data/v6.0/expected_attachment.rbi +33 -54
  85. data/spec/test_data/v6.0/expected_blob.rbi +33 -54
  86. data/spec/test_data/v6.0/expected_internal_metadata.rbi +33 -54
  87. data/spec/test_data/v6.0/expected_potion.rbi +33 -54
  88. data/spec/test_data/v6.0/expected_robe.rbi +33 -54
  89. data/spec/test_data/v6.0/expected_schema_migration.rbi +33 -54
  90. data/spec/test_data/v6.0/expected_school.rbi +33 -54
  91. data/spec/test_data/v6.0/expected_spell_book.rbi +46 -52
  92. data/spec/test_data/v6.0/expected_squib.rbi +42 -54
  93. data/spec/test_data/v6.0/expected_wand.rbi +47 -52
  94. data/spec/test_data/v6.0/expected_wizard.rbi +119 -56
  95. data/spec/test_data/v6.0/expected_wizard_wo_spellbook.rbi +119 -56
  96. data/spec/typed_enum_spec.rb +55 -0
  97. data/spec/typed_params_spec.rb +91 -0
  98. metadata +41 -4
  99. data/lib/sorbet-rails/model_plugins/active_record_factory_methods.rb +0 -28
@@ -133,51 +133,6 @@ class ActiveStorage::Attachment < ActiveRecord::Base
133
133
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(ActiveStorage::Attachment::ActiveRecord_Relation) }
134
134
  def self.extending(*args, &block); end
135
135
 
136
- sig { params(args: T.untyped).returns(ActiveStorage::Attachment) }
137
- def self.find(*args); end
138
-
139
- sig { params(args: T.untyped).returns(T.nilable(ActiveStorage::Attachment)) }
140
- def self.find_by(*args); end
141
-
142
- sig { params(args: T.untyped).returns(ActiveStorage::Attachment) }
143
- def self.find_by!(*args); end
144
-
145
- sig { returns(T.nilable(ActiveStorage::Attachment)) }
146
- def self.first; end
147
-
148
- sig { returns(ActiveStorage::Attachment) }
149
- def self.first!; end
150
-
151
- sig { returns(T.nilable(ActiveStorage::Attachment)) }
152
- def self.second; end
153
-
154
- sig { returns(ActiveStorage::Attachment) }
155
- def self.second!; end
156
-
157
- sig { returns(T.nilable(ActiveStorage::Attachment)) }
158
- def self.third; end
159
-
160
- sig { returns(ActiveStorage::Attachment) }
161
- def self.third!; end
162
-
163
- sig { returns(T.nilable(ActiveStorage::Attachment)) }
164
- def self.third_to_last; end
165
-
166
- sig { returns(ActiveStorage::Attachment) }
167
- def self.third_to_last!; end
168
-
169
- sig { returns(T.nilable(ActiveStorage::Attachment)) }
170
- def self.second_to_last; end
171
-
172
- sig { returns(ActiveStorage::Attachment) }
173
- def self.second_to_last!; end
174
-
175
- sig { returns(T.nilable(ActiveStorage::Attachment)) }
176
- def self.last; end
177
-
178
- sig { returns(ActiveStorage::Attachment) }
179
- def self.last!; end
180
-
181
136
  sig { params(conditions: T.untyped).returns(T::Boolean) }
182
137
  def self.exists?(conditions = nil); end
183
138
 
@@ -192,15 +147,6 @@ class ActiveStorage::Attachment < ActiveRecord::Base
192
147
 
193
148
  sig { params(args: T.untyped).returns(T::Boolean) }
194
149
  def self.one?(*args); end
195
-
196
- sig { params(attributes: T.untyped, block: T.untyped).returns(ActiveStorage::Attachment) }
197
- def self.create(attributes = nil, &block); end
198
-
199
- sig { params(attributes: T.untyped, block: T.untyped).returns(ActiveStorage::Attachment) }
200
- def self.create!(attributes = nil, &block); end
201
-
202
- sig { params(attributes: T.untyped, block: T.untyped).returns(ActiveStorage::Attachment) }
203
- def self.new(attributes = nil, &block); end
204
150
  end
205
151
 
206
152
  class ActiveStorage::Attachment::ActiveRecord_Relation < ActiveRecord::Relation
@@ -297,6 +243,21 @@ class ActiveStorage::Attachment::ActiveRecord_Relation < ActiveRecord::Relation
297
243
 
298
244
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(ActiveStorage::Attachment::ActiveRecord_Relation) }
299
245
  def extending(*args, &block); end
246
+
247
+ sig { params(conditions: T.untyped).returns(T::Boolean) }
248
+ def exists?(conditions = nil); end
249
+
250
+ sig { params(args: T.untyped).returns(T::Boolean) }
251
+ def any?(*args); end
252
+
253
+ sig { params(args: T.untyped).returns(T::Boolean) }
254
+ def many?(*args); end
255
+
256
+ sig { params(args: T.untyped).returns(T::Boolean) }
257
+ def none?(*args); end
258
+
259
+ sig { params(args: T.untyped).returns(T::Boolean) }
260
+ def one?(*args); end
300
261
  end
301
262
 
302
263
  class ActiveStorage::Attachment::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
@@ -403,6 +364,15 @@ class ActiveStorage::Attachment::ActiveRecord_AssociationRelation < ActiveRecord
403
364
  sig { params(args: T.untyped).returns(ActiveStorage::Attachment) }
404
365
  def find_by!(*args); end
405
366
 
367
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveStorage::Attachment).void)).returns(ActiveStorage::Attachment) }
368
+ def find_or_initialize_by(attributes, &block); end
369
+
370
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveStorage::Attachment).void)).returns(ActiveStorage::Attachment) }
371
+ def find_or_create_by(attributes, &block); end
372
+
373
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveStorage::Attachment).void)).returns(ActiveStorage::Attachment) }
374
+ def find_or_create_by!(attributes, &block); end
375
+
406
376
  sig { returns(T.nilable(ActiveStorage::Attachment)) }
407
377
  def first; end
408
378
 
@@ -575,6 +545,15 @@ class ActiveStorage::Attachment::ActiveRecord_Associations_CollectionProxy < Act
575
545
  sig { params(args: T.untyped).returns(ActiveStorage::Attachment) }
576
546
  def find_by!(*args); end
577
547
 
548
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveStorage::Attachment).void)).returns(ActiveStorage::Attachment) }
549
+ def find_or_initialize_by(attributes, &block); end
550
+
551
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveStorage::Attachment).void)).returns(ActiveStorage::Attachment) }
552
+ def find_or_create_by(attributes, &block); end
553
+
554
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveStorage::Attachment).void)).returns(ActiveStorage::Attachment) }
555
+ def find_or_create_by!(attributes, &block); end
556
+
578
557
  sig { returns(T.nilable(ActiveStorage::Attachment)) }
579
558
  def first; end
580
559
 
@@ -145,51 +145,6 @@ class ActiveStorage::Blob < ActiveRecord::Base
145
145
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(ActiveStorage::Blob::ActiveRecord_Relation) }
146
146
  def self.extending(*args, &block); end
147
147
 
148
- sig { params(args: T.untyped).returns(ActiveStorage::Blob) }
149
- def self.find(*args); end
150
-
151
- sig { params(args: T.untyped).returns(T.nilable(ActiveStorage::Blob)) }
152
- def self.find_by(*args); end
153
-
154
- sig { params(args: T.untyped).returns(ActiveStorage::Blob) }
155
- def self.find_by!(*args); end
156
-
157
- sig { returns(T.nilable(ActiveStorage::Blob)) }
158
- def self.first; end
159
-
160
- sig { returns(ActiveStorage::Blob) }
161
- def self.first!; end
162
-
163
- sig { returns(T.nilable(ActiveStorage::Blob)) }
164
- def self.second; end
165
-
166
- sig { returns(ActiveStorage::Blob) }
167
- def self.second!; end
168
-
169
- sig { returns(T.nilable(ActiveStorage::Blob)) }
170
- def self.third; end
171
-
172
- sig { returns(ActiveStorage::Blob) }
173
- def self.third!; end
174
-
175
- sig { returns(T.nilable(ActiveStorage::Blob)) }
176
- def self.third_to_last; end
177
-
178
- sig { returns(ActiveStorage::Blob) }
179
- def self.third_to_last!; end
180
-
181
- sig { returns(T.nilable(ActiveStorage::Blob)) }
182
- def self.second_to_last; end
183
-
184
- sig { returns(ActiveStorage::Blob) }
185
- def self.second_to_last!; end
186
-
187
- sig { returns(T.nilable(ActiveStorage::Blob)) }
188
- def self.last; end
189
-
190
- sig { returns(ActiveStorage::Blob) }
191
- def self.last!; end
192
-
193
148
  sig { params(conditions: T.untyped).returns(T::Boolean) }
194
149
  def self.exists?(conditions = nil); end
195
150
 
@@ -204,15 +159,6 @@ class ActiveStorage::Blob < ActiveRecord::Base
204
159
 
205
160
  sig { params(args: T.untyped).returns(T::Boolean) }
206
161
  def self.one?(*args); end
207
-
208
- sig { params(attributes: T.untyped, block: T.untyped).returns(ActiveStorage::Blob) }
209
- def self.create(attributes = nil, &block); end
210
-
211
- sig { params(attributes: T.untyped, block: T.untyped).returns(ActiveStorage::Blob) }
212
- def self.create!(attributes = nil, &block); end
213
-
214
- sig { params(attributes: T.untyped, block: T.untyped).returns(ActiveStorage::Blob) }
215
- def self.new(attributes = nil, &block); end
216
162
  end
217
163
 
218
164
  class ActiveStorage::Blob::ActiveRecord_Relation < ActiveRecord::Relation
@@ -315,6 +261,21 @@ class ActiveStorage::Blob::ActiveRecord_Relation < ActiveRecord::Relation
315
261
 
316
262
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(ActiveStorage::Blob::ActiveRecord_Relation) }
317
263
  def extending(*args, &block); end
264
+
265
+ sig { params(conditions: T.untyped).returns(T::Boolean) }
266
+ def exists?(conditions = nil); end
267
+
268
+ sig { params(args: T.untyped).returns(T::Boolean) }
269
+ def any?(*args); end
270
+
271
+ sig { params(args: T.untyped).returns(T::Boolean) }
272
+ def many?(*args); end
273
+
274
+ sig { params(args: T.untyped).returns(T::Boolean) }
275
+ def none?(*args); end
276
+
277
+ sig { params(args: T.untyped).returns(T::Boolean) }
278
+ def one?(*args); end
318
279
  end
319
280
 
320
281
  class ActiveStorage::Blob::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
@@ -427,6 +388,15 @@ class ActiveStorage::Blob::ActiveRecord_AssociationRelation < ActiveRecord::Asso
427
388
  sig { params(args: T.untyped).returns(ActiveStorage::Blob) }
428
389
  def find_by!(*args); end
429
390
 
391
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveStorage::Blob).void)).returns(ActiveStorage::Blob) }
392
+ def find_or_initialize_by(attributes, &block); end
393
+
394
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveStorage::Blob).void)).returns(ActiveStorage::Blob) }
395
+ def find_or_create_by(attributes, &block); end
396
+
397
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveStorage::Blob).void)).returns(ActiveStorage::Blob) }
398
+ def find_or_create_by!(attributes, &block); end
399
+
430
400
  sig { returns(T.nilable(ActiveStorage::Blob)) }
431
401
  def first; end
432
402
 
@@ -605,6 +575,15 @@ class ActiveStorage::Blob::ActiveRecord_Associations_CollectionProxy < ActiveRec
605
575
  sig { params(args: T.untyped).returns(ActiveStorage::Blob) }
606
576
  def find_by!(*args); end
607
577
 
578
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveStorage::Blob).void)).returns(ActiveStorage::Blob) }
579
+ def find_or_initialize_by(attributes, &block); end
580
+
581
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveStorage::Blob).void)).returns(ActiveStorage::Blob) }
582
+ def find_or_create_by(attributes, &block); end
583
+
584
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveStorage::Blob).void)).returns(ActiveStorage::Blob) }
585
+ def find_or_create_by!(attributes, &block); end
586
+
608
587
  sig { returns(T.nilable(ActiveStorage::Blob)) }
609
588
  def first; end
610
589
 
@@ -157,51 +157,6 @@ class ActiveRecord::InternalMetadata < ActiveRecord::Base
157
157
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(ActiveRecord::InternalMetadata::ActiveRecord_Relation) }
158
158
  def self.extending(*args, &block); end
159
159
 
160
- sig { params(args: T.untyped).returns(ActiveRecord::InternalMetadata) }
161
- def self.find(*args); end
162
-
163
- sig { params(args: T.untyped).returns(T.nilable(ActiveRecord::InternalMetadata)) }
164
- def self.find_by(*args); end
165
-
166
- sig { params(args: T.untyped).returns(ActiveRecord::InternalMetadata) }
167
- def self.find_by!(*args); end
168
-
169
- sig { returns(T.nilable(ActiveRecord::InternalMetadata)) }
170
- def self.first; end
171
-
172
- sig { returns(ActiveRecord::InternalMetadata) }
173
- def self.first!; end
174
-
175
- sig { returns(T.nilable(ActiveRecord::InternalMetadata)) }
176
- def self.second; end
177
-
178
- sig { returns(ActiveRecord::InternalMetadata) }
179
- def self.second!; end
180
-
181
- sig { returns(T.nilable(ActiveRecord::InternalMetadata)) }
182
- def self.third; end
183
-
184
- sig { returns(ActiveRecord::InternalMetadata) }
185
- def self.third!; end
186
-
187
- sig { returns(T.nilable(ActiveRecord::InternalMetadata)) }
188
- def self.third_to_last; end
189
-
190
- sig { returns(ActiveRecord::InternalMetadata) }
191
- def self.third_to_last!; end
192
-
193
- sig { returns(T.nilable(ActiveRecord::InternalMetadata)) }
194
- def self.second_to_last; end
195
-
196
- sig { returns(ActiveRecord::InternalMetadata) }
197
- def self.second_to_last!; end
198
-
199
- sig { returns(T.nilable(ActiveRecord::InternalMetadata)) }
200
- def self.last; end
201
-
202
- sig { returns(ActiveRecord::InternalMetadata) }
203
- def self.last!; end
204
-
205
160
  sig { params(conditions: T.untyped).returns(T::Boolean) }
206
161
  def self.exists?(conditions = nil); end
207
162
 
@@ -216,15 +171,6 @@ class ActiveRecord::InternalMetadata < ActiveRecord::Base
216
171
 
217
172
  sig { params(args: T.untyped).returns(T::Boolean) }
218
173
  def self.one?(*args); end
219
-
220
- sig { params(attributes: T.untyped, block: T.untyped).returns(ActiveRecord::InternalMetadata) }
221
- def self.create(attributes = nil, &block); end
222
-
223
- sig { params(attributes: T.untyped, block: T.untyped).returns(ActiveRecord::InternalMetadata) }
224
- def self.create!(attributes = nil, &block); end
225
-
226
- sig { params(attributes: T.untyped, block: T.untyped).returns(ActiveRecord::InternalMetadata) }
227
- def self.new(attributes = nil, &block); end
228
174
  end
229
175
 
230
176
  class ActiveRecord::InternalMetadata::ActiveRecord_Relation < ActiveRecord::Relation
@@ -321,6 +267,21 @@ class ActiveRecord::InternalMetadata::ActiveRecord_Relation < ActiveRecord::Rela
321
267
 
322
268
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(ActiveRecord::InternalMetadata::ActiveRecord_Relation) }
323
269
  def extending(*args, &block); end
270
+
271
+ sig { params(conditions: T.untyped).returns(T::Boolean) }
272
+ def exists?(conditions = nil); end
273
+
274
+ sig { params(args: T.untyped).returns(T::Boolean) }
275
+ def any?(*args); end
276
+
277
+ sig { params(args: T.untyped).returns(T::Boolean) }
278
+ def many?(*args); end
279
+
280
+ sig { params(args: T.untyped).returns(T::Boolean) }
281
+ def none?(*args); end
282
+
283
+ sig { params(args: T.untyped).returns(T::Boolean) }
284
+ def one?(*args); end
324
285
  end
325
286
 
326
287
  class ActiveRecord::InternalMetadata::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
@@ -427,6 +388,15 @@ class ActiveRecord::InternalMetadata::ActiveRecord_AssociationRelation < ActiveR
427
388
  sig { params(args: T.untyped).returns(ActiveRecord::InternalMetadata) }
428
389
  def find_by!(*args); end
429
390
 
391
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveRecord::InternalMetadata).void)).returns(ActiveRecord::InternalMetadata) }
392
+ def find_or_initialize_by(attributes, &block); end
393
+
394
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveRecord::InternalMetadata).void)).returns(ActiveRecord::InternalMetadata) }
395
+ def find_or_create_by(attributes, &block); end
396
+
397
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveRecord::InternalMetadata).void)).returns(ActiveRecord::InternalMetadata) }
398
+ def find_or_create_by!(attributes, &block); end
399
+
430
400
  sig { returns(T.nilable(ActiveRecord::InternalMetadata)) }
431
401
  def first; end
432
402
 
@@ -599,6 +569,15 @@ class ActiveRecord::InternalMetadata::ActiveRecord_Associations_CollectionProxy
599
569
  sig { params(args: T.untyped).returns(ActiveRecord::InternalMetadata) }
600
570
  def find_by!(*args); end
601
571
 
572
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveRecord::InternalMetadata).void)).returns(ActiveRecord::InternalMetadata) }
573
+ def find_or_initialize_by(attributes, &block); end
574
+
575
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveRecord::InternalMetadata).void)).returns(ActiveRecord::InternalMetadata) }
576
+ def find_or_create_by(attributes, &block); end
577
+
578
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveRecord::InternalMetadata).void)).returns(ActiveRecord::InternalMetadata) }
579
+ def find_or_create_by!(attributes, &block); end
580
+
602
581
  sig { returns(T.nilable(ActiveRecord::InternalMetadata)) }
603
582
  def first; end
604
583
 
@@ -127,51 +127,6 @@ class Potion < ApplicationRecord
127
127
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Potion::ActiveRecord_Relation) }
128
128
  def self.extending(*args, &block); end
129
129
 
130
- sig { params(args: T.untyped).returns(Potion) }
131
- def self.find(*args); end
132
-
133
- sig { params(args: T.untyped).returns(T.nilable(Potion)) }
134
- def self.find_by(*args); end
135
-
136
- sig { params(args: T.untyped).returns(Potion) }
137
- def self.find_by!(*args); end
138
-
139
- sig { returns(T.nilable(Potion)) }
140
- def self.first; end
141
-
142
- sig { returns(Potion) }
143
- def self.first!; end
144
-
145
- sig { returns(T.nilable(Potion)) }
146
- def self.second; end
147
-
148
- sig { returns(Potion) }
149
- def self.second!; end
150
-
151
- sig { returns(T.nilable(Potion)) }
152
- def self.third; end
153
-
154
- sig { returns(Potion) }
155
- def self.third!; end
156
-
157
- sig { returns(T.nilable(Potion)) }
158
- def self.third_to_last; end
159
-
160
- sig { returns(Potion) }
161
- def self.third_to_last!; end
162
-
163
- sig { returns(T.nilable(Potion)) }
164
- def self.second_to_last; end
165
-
166
- sig { returns(Potion) }
167
- def self.second_to_last!; end
168
-
169
- sig { returns(T.nilable(Potion)) }
170
- def self.last; end
171
-
172
- sig { returns(Potion) }
173
- def self.last!; end
174
-
175
130
  sig { params(conditions: T.untyped).returns(T::Boolean) }
176
131
  def self.exists?(conditions = nil); end
177
132
 
@@ -186,15 +141,6 @@ class Potion < ApplicationRecord
186
141
 
187
142
  sig { params(args: T.untyped).returns(T::Boolean) }
188
143
  def self.one?(*args); end
189
-
190
- sig { params(attributes: T.untyped, block: T.untyped).returns(Potion) }
191
- def self.create(attributes = nil, &block); end
192
-
193
- sig { params(attributes: T.untyped, block: T.untyped).returns(Potion) }
194
- def self.create!(attributes = nil, &block); end
195
-
196
- sig { params(attributes: T.untyped, block: T.untyped).returns(Potion) }
197
- def self.new(attributes = nil, &block); end
198
144
  end
199
145
 
200
146
  class Potion::ActiveRecord_Relation < ActiveRecord::Relation
@@ -291,6 +237,21 @@ class Potion::ActiveRecord_Relation < ActiveRecord::Relation
291
237
 
292
238
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Potion::ActiveRecord_Relation) }
293
239
  def extending(*args, &block); end
240
+
241
+ sig { params(conditions: T.untyped).returns(T::Boolean) }
242
+ def exists?(conditions = nil); end
243
+
244
+ sig { params(args: T.untyped).returns(T::Boolean) }
245
+ def any?(*args); end
246
+
247
+ sig { params(args: T.untyped).returns(T::Boolean) }
248
+ def many?(*args); end
249
+
250
+ sig { params(args: T.untyped).returns(T::Boolean) }
251
+ def none?(*args); end
252
+
253
+ sig { params(args: T.untyped).returns(T::Boolean) }
254
+ def one?(*args); end
294
255
  end
295
256
 
296
257
  class Potion::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
@@ -397,6 +358,15 @@ class Potion::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelati
397
358
  sig { params(args: T.untyped).returns(Potion) }
398
359
  def find_by!(*args); end
399
360
 
361
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Potion).void)).returns(Potion) }
362
+ def find_or_initialize_by(attributes, &block); end
363
+
364
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Potion).void)).returns(Potion) }
365
+ def find_or_create_by(attributes, &block); end
366
+
367
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Potion).void)).returns(Potion) }
368
+ def find_or_create_by!(attributes, &block); end
369
+
400
370
  sig { returns(T.nilable(Potion)) }
401
371
  def first; end
402
372
 
@@ -569,6 +539,15 @@ class Potion::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associat
569
539
  sig { params(args: T.untyped).returns(Potion) }
570
540
  def find_by!(*args); end
571
541
 
542
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Potion).void)).returns(Potion) }
543
+ def find_or_initialize_by(attributes, &block); end
544
+
545
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Potion).void)).returns(Potion) }
546
+ def find_or_create_by(attributes, &block); end
547
+
548
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Potion).void)).returns(Potion) }
549
+ def find_or_create_by!(attributes, &block); end
550
+
572
551
  sig { returns(T.nilable(Potion)) }
573
552
  def first; end
574
553