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
@@ -151,51 +151,6 @@ class School < ApplicationRecord
151
151
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(School::ActiveRecord_Relation) }
152
152
  def self.extending(*args, &block); end
153
153
 
154
- sig { params(args: T.untyped).returns(School) }
155
- def self.find(*args); end
156
-
157
- sig { params(args: T.untyped).returns(T.nilable(School)) }
158
- def self.find_by(*args); end
159
-
160
- sig { params(args: T.untyped).returns(School) }
161
- def self.find_by!(*args); end
162
-
163
- sig { returns(T.nilable(School)) }
164
- def self.first; end
165
-
166
- sig { returns(School) }
167
- def self.first!; end
168
-
169
- sig { returns(T.nilable(School)) }
170
- def self.second; end
171
-
172
- sig { returns(School) }
173
- def self.second!; end
174
-
175
- sig { returns(T.nilable(School)) }
176
- def self.third; end
177
-
178
- sig { returns(School) }
179
- def self.third!; end
180
-
181
- sig { returns(T.nilable(School)) }
182
- def self.third_to_last; end
183
-
184
- sig { returns(School) }
185
- def self.third_to_last!; end
186
-
187
- sig { returns(T.nilable(School)) }
188
- def self.second_to_last; end
189
-
190
- sig { returns(School) }
191
- def self.second_to_last!; end
192
-
193
- sig { returns(T.nilable(School)) }
194
- def self.last; end
195
-
196
- sig { returns(School) }
197
- def self.last!; end
198
-
199
154
  sig { params(conditions: T.untyped).returns(T::Boolean) }
200
155
  def self.exists?(conditions = nil); end
201
156
 
@@ -210,15 +165,6 @@ class School < ApplicationRecord
210
165
 
211
166
  sig { params(args: T.untyped).returns(T::Boolean) }
212
167
  def self.one?(*args); end
213
-
214
- sig { params(attributes: T.untyped, block: T.untyped).returns(School) }
215
- def self.create(attributes = nil, &block); end
216
-
217
- sig { params(attributes: T.untyped, block: T.untyped).returns(School) }
218
- def self.create!(attributes = nil, &block); end
219
-
220
- sig { params(attributes: T.untyped, block: T.untyped).returns(School) }
221
- def self.new(attributes = nil, &block); end
222
168
  end
223
169
 
224
170
  class School::ActiveRecord_Relation < ActiveRecord::Relation
@@ -327,6 +273,21 @@ class School::ActiveRecord_Relation < ActiveRecord::Relation
327
273
 
328
274
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(School::ActiveRecord_Relation) }
329
275
  def extending(*args, &block); end
276
+
277
+ sig { params(conditions: T.untyped).returns(T::Boolean) }
278
+ def exists?(conditions = nil); end
279
+
280
+ sig { params(args: T.untyped).returns(T::Boolean) }
281
+ def any?(*args); end
282
+
283
+ sig { params(args: T.untyped).returns(T::Boolean) }
284
+ def many?(*args); end
285
+
286
+ sig { params(args: T.untyped).returns(T::Boolean) }
287
+ def none?(*args); end
288
+
289
+ sig { params(args: T.untyped).returns(T::Boolean) }
290
+ def one?(*args); end
330
291
  end
331
292
 
332
293
  class School::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
@@ -445,6 +406,15 @@ class School::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelati
445
406
  sig { params(args: T.untyped).returns(School) }
446
407
  def find_by!(*args); end
447
408
 
409
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: School).void)).returns(School) }
410
+ def find_or_initialize_by(attributes, &block); end
411
+
412
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: School).void)).returns(School) }
413
+ def find_or_create_by(attributes, &block); end
414
+
415
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: School).void)).returns(School) }
416
+ def find_or_create_by!(attributes, &block); end
417
+
448
418
  sig { returns(T.nilable(School)) }
449
419
  def first; end
450
420
 
@@ -629,6 +599,15 @@ class School::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associat
629
599
  sig { params(args: T.untyped).returns(School) }
630
600
  def find_by!(*args); end
631
601
 
602
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: School).void)).returns(School) }
603
+ def find_or_initialize_by(attributes, &block); end
604
+
605
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: School).void)).returns(School) }
606
+ def find_or_create_by(attributes, &block); end
607
+
608
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: School).void)).returns(School) }
609
+ def find_or_create_by!(attributes, &block); end
610
+
632
611
  sig { returns(T.nilable(School)) }
633
612
  def first; end
634
613
 
@@ -69,6 +69,15 @@ module SpellBook::GeneratedAttributeMethods
69
69
  def wizard_id?; end
70
70
  end
71
71
 
72
+ class SpellBook::BookType < T::Enum
73
+ enums do
74
+ Unclassified = new('unclassified')
75
+ Biology = new('biology')
76
+ DarkArt = new('dark_art')
77
+ end
78
+
79
+ end
80
+
72
81
  module SpellBook::GeneratedAssociationMethods
73
82
  extend T::Sig
74
83
 
@@ -224,50 +233,11 @@ class SpellBook < ApplicationRecord
224
233
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(SpellBook::ActiveRecord_Relation) }
225
234
  def self.extending(*args, &block); end
226
235
 
227
- sig { params(args: T.untyped).returns(SpellBook) }
228
- def self.find(*args); end
229
-
230
- sig { params(args: T.untyped).returns(T.nilable(SpellBook)) }
231
- def self.find_by(*args); end
232
-
233
- sig { params(args: T.untyped).returns(SpellBook) }
234
- def self.find_by!(*args); end
235
-
236
- sig { returns(T.nilable(SpellBook)) }
237
- def self.first; end
238
-
239
- sig { returns(SpellBook) }
240
- def self.first!; end
241
-
242
- sig { returns(T.nilable(SpellBook)) }
243
- def self.second; end
244
-
245
- sig { returns(SpellBook) }
246
- def self.second!; end
247
-
248
- sig { returns(T.nilable(SpellBook)) }
249
- def self.third; end
250
-
251
- sig { returns(SpellBook) }
252
- def self.third!; end
253
-
254
- sig { returns(T.nilable(SpellBook)) }
255
- def self.third_to_last; end
256
-
257
- sig { returns(SpellBook) }
258
- def self.third_to_last!; end
259
-
260
- sig { returns(T.nilable(SpellBook)) }
261
- def self.second_to_last; end
262
-
263
- sig { returns(SpellBook) }
264
- def self.second_to_last!; end
265
-
266
- sig { returns(T.nilable(SpellBook)) }
267
- def self.last; end
236
+ sig { returns(SpellBook::BookType) }
237
+ def typed_book_type; end
268
238
 
269
- sig { returns(SpellBook) }
270
- def self.last!; end
239
+ sig { params(value: SpellBook::BookType).void }
240
+ def typed_book_type=(value); end
271
241
 
272
242
  sig { params(conditions: T.untyped).returns(T::Boolean) }
273
243
  def self.exists?(conditions = nil); end
@@ -283,15 +253,6 @@ class SpellBook < ApplicationRecord
283
253
 
284
254
  sig { params(args: T.untyped).returns(T::Boolean) }
285
255
  def self.one?(*args); end
286
-
287
- sig { params(attributes: T.untyped, block: T.untyped).returns(SpellBook) }
288
- def self.create(attributes = nil, &block); end
289
-
290
- sig { params(attributes: T.untyped, block: T.untyped).returns(SpellBook) }
291
- def self.create!(attributes = nil, &block); end
292
-
293
- sig { params(attributes: T.untyped, block: T.untyped).returns(SpellBook) }
294
- def self.new(attributes = nil, &block); end
295
256
  end
296
257
 
297
258
  class SpellBook::ActiveRecord_Relation < ActiveRecord::Relation
@@ -418,6 +379,21 @@ class SpellBook::ActiveRecord_Relation < ActiveRecord::Relation
418
379
 
419
380
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(SpellBook::ActiveRecord_Relation) }
420
381
  def extending(*args, &block); end
382
+
383
+ sig { params(conditions: T.untyped).returns(T::Boolean) }
384
+ def exists?(conditions = nil); end
385
+
386
+ sig { params(args: T.untyped).returns(T::Boolean) }
387
+ def any?(*args); end
388
+
389
+ sig { params(args: T.untyped).returns(T::Boolean) }
390
+ def many?(*args); end
391
+
392
+ sig { params(args: T.untyped).returns(T::Boolean) }
393
+ def none?(*args); end
394
+
395
+ sig { params(args: T.untyped).returns(T::Boolean) }
396
+ def one?(*args); end
421
397
  end
422
398
 
423
399
  class SpellBook::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
@@ -554,6 +530,15 @@ class SpellBook::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRel
554
530
  sig { params(args: T.untyped).returns(SpellBook) }
555
531
  def find_by!(*args); end
556
532
 
533
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: SpellBook).void)).returns(SpellBook) }
534
+ def find_or_initialize_by(attributes, &block); end
535
+
536
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: SpellBook).void)).returns(SpellBook) }
537
+ def find_or_create_by(attributes, &block); end
538
+
539
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: SpellBook).void)).returns(SpellBook) }
540
+ def find_or_create_by!(attributes, &block); end
541
+
557
542
  sig { returns(T.nilable(SpellBook)) }
558
543
  def first; end
559
544
 
@@ -756,6 +741,15 @@ class SpellBook::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Assoc
756
741
  sig { params(args: T.untyped).returns(SpellBook) }
757
742
  def find_by!(*args); end
758
743
 
744
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: SpellBook).void)).returns(SpellBook) }
745
+ def find_or_initialize_by(attributes, &block); end
746
+
747
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: SpellBook).void)).returns(SpellBook) }
748
+ def find_or_create_by(attributes, &block); end
749
+
750
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: SpellBook).void)).returns(SpellBook) }
751
+ def find_or_create_by!(attributes, &block); end
752
+
759
753
  sig { returns(T.nilable(SpellBook)) }
760
754
  def first; end
761
755
 
@@ -206,6 +206,15 @@ module Squib::GeneratedAttributeMethods
206
206
  sig { returns(T::Boolean) }
207
207
  def parent_email?; end
208
208
 
209
+ sig { returns(T.nilable(String)) }
210
+ def professor; end
211
+
212
+ sig { params(value: T.nilable(T.any(Integer, String, Symbol))).void }
213
+ def professor=(value); end
214
+
215
+ sig { returns(T::Boolean) }
216
+ def professor?; end
217
+
209
218
  sig { returns(T.nilable(String)) }
210
219
  def quidditch_position; end
211
220
 
@@ -496,51 +505,6 @@ class Squib < Wizard
496
505
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
497
506
  def self.extending(*args, &block); end
498
507
 
499
- sig { params(args: T.untyped).returns(Squib) }
500
- def self.find(*args); end
501
-
502
- sig { params(args: T.untyped).returns(T.nilable(Squib)) }
503
- def self.find_by(*args); end
504
-
505
- sig { params(args: T.untyped).returns(Squib) }
506
- def self.find_by!(*args); end
507
-
508
- sig { returns(T.nilable(Squib)) }
509
- def self.first; end
510
-
511
- sig { returns(Squib) }
512
- def self.first!; end
513
-
514
- sig { returns(T.nilable(Squib)) }
515
- def self.second; end
516
-
517
- sig { returns(Squib) }
518
- def self.second!; end
519
-
520
- sig { returns(T.nilable(Squib)) }
521
- def self.third; end
522
-
523
- sig { returns(Squib) }
524
- def self.third!; end
525
-
526
- sig { returns(T.nilable(Squib)) }
527
- def self.third_to_last; end
528
-
529
- sig { returns(Squib) }
530
- def self.third_to_last!; end
531
-
532
- sig { returns(T.nilable(Squib)) }
533
- def self.second_to_last; end
534
-
535
- sig { returns(Squib) }
536
- def self.second_to_last!; end
537
-
538
- sig { returns(T.nilable(Squib)) }
539
- def self.last; end
540
-
541
- sig { returns(Squib) }
542
- def self.last!; end
543
-
544
508
  sig { params(conditions: T.untyped).returns(T::Boolean) }
545
509
  def self.exists?(conditions = nil); end
546
510
 
@@ -555,15 +519,6 @@ class Squib < Wizard
555
519
 
556
520
  sig { params(args: T.untyped).returns(T::Boolean) }
557
521
  def self.one?(*args); end
558
-
559
- sig { params(attributes: T.untyped, block: T.untyped).returns(Squib) }
560
- def self.create(attributes = nil, &block); end
561
-
562
- sig { params(attributes: T.untyped, block: T.untyped).returns(Squib) }
563
- def self.create!(attributes = nil, &block); end
564
-
565
- sig { params(attributes: T.untyped, block: T.untyped).returns(Squib) }
566
- def self.new(attributes = nil, &block); end
567
522
  end
568
523
 
569
524
  class Squib::ActiveRecord_Relation < ActiveRecord::Relation
@@ -783,6 +738,21 @@ class Squib::ActiveRecord_Relation < ActiveRecord::Relation
783
738
 
784
739
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
785
740
  def extending(*args, &block); end
741
+
742
+ sig { params(conditions: T.untyped).returns(T::Boolean) }
743
+ def exists?(conditions = nil); end
744
+
745
+ sig { params(args: T.untyped).returns(T::Boolean) }
746
+ def any?(*args); end
747
+
748
+ sig { params(args: T.untyped).returns(T::Boolean) }
749
+ def many?(*args); end
750
+
751
+ sig { params(args: T.untyped).returns(T::Boolean) }
752
+ def none?(*args); end
753
+
754
+ sig { params(args: T.untyped).returns(T::Boolean) }
755
+ def one?(*args); end
786
756
  end
787
757
 
788
758
  class Squib::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
@@ -1012,6 +982,15 @@ class Squib::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelatio
1012
982
  sig { params(args: T.untyped).returns(Squib) }
1013
983
  def find_by!(*args); end
1014
984
 
985
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
986
+ def find_or_initialize_by(attributes, &block); end
987
+
988
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
989
+ def find_or_create_by(attributes, &block); end
990
+
991
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
992
+ def find_or_create_by!(attributes, &block); end
993
+
1015
994
  sig { returns(T.nilable(Squib)) }
1016
995
  def first; end
1017
996
 
@@ -1307,6 +1286,15 @@ class Squib::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associati
1307
1286
  sig { params(args: T.untyped).returns(Squib) }
1308
1287
  def find_by!(*args); end
1309
1288
 
1289
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
1290
+ def find_or_initialize_by(attributes, &block); end
1291
+
1292
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
1293
+ def find_or_create_by(attributes, &block); end
1294
+
1295
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
1296
+ def find_or_create_by!(attributes, &block); end
1297
+
1310
1298
  sig { returns(T.nilable(Squib)) }
1311
1299
  def first; end
1312
1300
 
@@ -174,6 +174,16 @@ module Wand::GeneratedAttributeMethods
174
174
  def wood_type?; end
175
175
  end
176
176
 
177
+ class Wand::CoreType < T::Enum
178
+ enums do
179
+ PhoenixFeather = new('phoenix_feather')
180
+ DragonHeartstring = new('dragon_heartstring')
181
+ UnicornTailHair = new('unicorn_tail_hair')
182
+ BasiliskHorn = new('basilisk_horn')
183
+ end
184
+
185
+ end
186
+
177
187
  module Wand::GeneratedAssociationMethods
178
188
  extend T::Sig
179
189
 
@@ -335,50 +345,11 @@ class Wand < ApplicationRecord
335
345
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_Relation) }
336
346
  def self.extending(*args, &block); end
337
347
 
338
- sig { params(args: T.untyped).returns(Wand) }
339
- def self.find(*args); end
340
-
341
- sig { params(args: T.untyped).returns(T.nilable(Wand)) }
342
- def self.find_by(*args); end
343
-
344
- sig { params(args: T.untyped).returns(Wand) }
345
- def self.find_by!(*args); end
346
-
347
- sig { returns(T.nilable(Wand)) }
348
- def self.first; end
349
-
350
- sig { returns(Wand) }
351
- def self.first!; end
352
-
353
- sig { returns(T.nilable(Wand)) }
354
- def self.second; end
355
-
356
- sig { returns(Wand) }
357
- def self.second!; end
358
-
359
- sig { returns(T.nilable(Wand)) }
360
- def self.third; end
361
-
362
- sig { returns(Wand) }
363
- def self.third!; end
364
-
365
- sig { returns(T.nilable(Wand)) }
366
- def self.third_to_last; end
367
-
368
- sig { returns(Wand) }
369
- def self.third_to_last!; end
370
-
371
- sig { returns(T.nilable(Wand)) }
372
- def self.second_to_last; end
373
-
374
- sig { returns(Wand) }
375
- def self.second_to_last!; end
376
-
377
- sig { returns(T.nilable(Wand)) }
378
- def self.last; end
348
+ sig { returns(T.nilable(Wand::CoreType)) }
349
+ def typed_core_type; end
379
350
 
380
- sig { returns(Wand) }
381
- def self.last!; end
351
+ sig { params(value: T.nilable(Wand::CoreType)).void }
352
+ def typed_core_type=(value); end
382
353
 
383
354
  sig { params(conditions: T.untyped).returns(T::Boolean) }
384
355
  def self.exists?(conditions = nil); end
@@ -395,15 +366,6 @@ class Wand < ApplicationRecord
395
366
  sig { params(args: T.untyped).returns(T::Boolean) }
396
367
  def self.one?(*args); end
397
368
 
398
- sig { params(attributes: T.untyped, block: T.untyped).returns(Wand) }
399
- def self.create(attributes = nil, &block); end
400
-
401
- sig { params(attributes: T.untyped, block: T.untyped).returns(Wand) }
402
- def self.create!(attributes = nil, &block); end
403
-
404
- sig { params(attributes: T.untyped, block: T.untyped).returns(Wand) }
405
- def self.new(attributes = nil, &block); end
406
-
407
369
  sig { returns(T::Array[Wand]) }
408
370
  def self.mythicals; end
409
371
  end
@@ -538,6 +500,21 @@ class Wand::ActiveRecord_Relation < ActiveRecord::Relation
538
500
 
539
501
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_Relation) }
540
502
  def extending(*args, &block); end
503
+
504
+ sig { params(conditions: T.untyped).returns(T::Boolean) }
505
+ def exists?(conditions = nil); end
506
+
507
+ sig { params(args: T.untyped).returns(T::Boolean) }
508
+ def any?(*args); end
509
+
510
+ sig { params(args: T.untyped).returns(T::Boolean) }
511
+ def many?(*args); end
512
+
513
+ sig { params(args: T.untyped).returns(T::Boolean) }
514
+ def none?(*args); end
515
+
516
+ sig { params(args: T.untyped).returns(T::Boolean) }
517
+ def one?(*args); end
541
518
  end
542
519
 
543
520
  class Wand::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
@@ -680,6 +657,15 @@ class Wand::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
680
657
  sig { params(args: T.untyped).returns(Wand) }
681
658
  def find_by!(*args); end
682
659
 
660
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
661
+ def find_or_initialize_by(attributes, &block); end
662
+
663
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
664
+ def find_or_create_by(attributes, &block); end
665
+
666
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
667
+ def find_or_create_by!(attributes, &block); end
668
+
683
669
  sig { returns(T.nilable(Wand)) }
684
670
  def first; end
685
671
 
@@ -888,6 +874,15 @@ class Wand::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associatio
888
874
  sig { params(args: T.untyped).returns(Wand) }
889
875
  def find_by!(*args); end
890
876
 
877
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
878
+ def find_or_initialize_by(attributes, &block); end
879
+
880
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
881
+ def find_or_create_by(attributes, &block); end
882
+
883
+ sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
884
+ def find_or_create_by!(attributes, &block); end
885
+
891
886
  sig { returns(T.nilable(Wand)) }
892
887
  def first; end
893
888