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.
- checksums.yaml +4 -4
- data/.gitattributes +4 -0
- data/.travis.yml +3 -3
- data/README.md +129 -52
- data/lib/bundled_rbi/active_record_base.rbi +83 -0
- data/lib/bundled_rbi/active_record_relation.rbi +43 -0
- data/lib/bundled_rbi/pluck_to_tstruct.rbi +0 -1
- data/lib/bundled_rbi/typed_params.rbi +9 -0
- data/lib/sorbet-rails.rb +1 -0
- data/lib/sorbet-rails/config.rb +0 -1
- data/lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb +1 -1
- data/lib/sorbet-rails/gem_plugins/friendly_id_plugin.rb +1 -1
- data/lib/sorbet-rails/model_plugins/active_record_assoc.rb +3 -3
- data/lib/sorbet-rails/model_plugins/active_record_attribute.rb +85 -17
- data/lib/sorbet-rails/model_plugins/active_record_enum.rb +0 -2
- data/lib/sorbet-rails/model_plugins/active_record_finder_methods.rb +49 -12
- data/lib/sorbet-rails/model_plugins/active_record_querying.rb +1 -1
- data/lib/sorbet-rails/model_plugins/active_storage_methods.rb +1 -1
- data/lib/sorbet-rails/model_plugins/plugins.rb +0 -3
- data/lib/sorbet-rails/rails_mixins/active_record_overrides.rb +156 -5
- data/lib/sorbet-rails/rails_mixins/generated_url_helpers.rb +16 -0
- data/lib/sorbet-rails/railtie.rb +2 -1
- data/lib/sorbet-rails/tasks/rails_rbi.rake +2 -0
- data/lib/sorbet-rails/type_assert/actionpack.rbi +4 -0
- data/lib/sorbet-rails/type_assert/type_assert.rb +1 -1
- data/lib/sorbet-rails/typed_params.rb +22 -0
- data/lib/sorbet-rails/utils.rb +5 -0
- data/sorbet-rails.gemspec +5 -3
- data/spec/generators/rails-template.rb +7 -3
- data/spec/generators/sorbet_test_cases.rb +46 -1
- data/spec/sorbet_spec.rb +3 -1
- data/spec/support/v5.0/Gemfile.lock +36 -23
- data/spec/support/v5.0/app/models/wizard.rb +6 -3
- data/spec/support/v5.0/db/migrate/20190620000001_create_wizards.rb +1 -0
- data/spec/support/v5.0/db/schema.rb +1 -0
- data/spec/support/v5.0/sorbet_test_cases.rb +46 -1
- data/spec/support/v5.1/Gemfile.lock +37 -24
- data/spec/support/v5.1/app/models/wizard.rb +6 -3
- data/spec/support/v5.1/db/migrate/20190620000001_create_wizards.rb +1 -0
- data/spec/support/v5.1/db/schema.rb +1 -0
- data/spec/support/v5.1/sorbet_test_cases.rb +46 -1
- data/spec/support/v5.2/Gemfile.lock +75 -62
- data/spec/support/v5.2/app/models/wizard.rb +6 -3
- data/spec/support/v5.2/db/migrate/20190620000001_create_wizards.rb +1 -0
- data/spec/support/v5.2/db/schema.rb +1 -0
- data/spec/support/v5.2/sorbet_test_cases.rb +46 -1
- data/spec/support/v6.0/Gemfile.lock +89 -76
- data/spec/support/v6.0/app/models/wizard.rb +6 -3
- data/spec/support/v6.0/db/migrate/20190620000001_create_wizards.rb +1 -0
- data/spec/support/v6.0/db/schema.rb +1 -0
- data/spec/support/v6.0/sorbet_test_cases.rb +46 -1
- data/spec/test_data/v5.0/expected_internal_metadata.rbi +33 -54
- data/spec/test_data/v5.0/expected_potion.rbi +33 -54
- data/spec/test_data/v5.0/expected_robe.rbi +33 -54
- data/spec/test_data/v5.0/expected_schema_migration.rbi +33 -54
- data/spec/test_data/v5.0/expected_school.rbi +33 -54
- data/spec/test_data/v5.0/expected_spell_book.rbi +46 -52
- data/spec/test_data/v5.0/expected_squib.rbi +42 -54
- data/spec/test_data/v5.0/expected_wand.rbi +47 -52
- data/spec/test_data/v5.0/expected_wizard.rbi +119 -56
- data/spec/test_data/v5.0/expected_wizard_wo_spellbook.rbi +119 -56
- data/spec/test_data/v5.1/expected_internal_metadata.rbi +33 -54
- data/spec/test_data/v5.1/expected_potion.rbi +33 -54
- data/spec/test_data/v5.1/expected_robe.rbi +33 -54
- data/spec/test_data/v5.1/expected_schema_migration.rbi +33 -54
- data/spec/test_data/v5.1/expected_school.rbi +33 -54
- data/spec/test_data/v5.1/expected_spell_book.rbi +46 -52
- data/spec/test_data/v5.1/expected_squib.rbi +42 -54
- data/spec/test_data/v5.1/expected_wand.rbi +47 -52
- data/spec/test_data/v5.1/expected_wizard.rbi +119 -56
- data/spec/test_data/v5.1/expected_wizard_wo_spellbook.rbi +119 -56
- data/spec/test_data/v5.2/expected_attachment.rbi +33 -54
- data/spec/test_data/v5.2/expected_blob.rbi +33 -54
- data/spec/test_data/v5.2/expected_internal_metadata.rbi +33 -54
- data/spec/test_data/v5.2/expected_potion.rbi +33 -54
- data/spec/test_data/v5.2/expected_robe.rbi +33 -54
- data/spec/test_data/v5.2/expected_schema_migration.rbi +33 -54
- data/spec/test_data/v5.2/expected_school.rbi +33 -54
- data/spec/test_data/v5.2/expected_spell_book.rbi +46 -52
- data/spec/test_data/v5.2/expected_squib.rbi +42 -54
- data/spec/test_data/v5.2/expected_wand.rbi +47 -52
- data/spec/test_data/v5.2/expected_wizard.rbi +119 -56
- data/spec/test_data/v5.2/expected_wizard_wo_spellbook.rbi +119 -56
- data/spec/test_data/v6.0/expected_attachment.rbi +33 -54
- data/spec/test_data/v6.0/expected_blob.rbi +33 -54
- data/spec/test_data/v6.0/expected_internal_metadata.rbi +33 -54
- data/spec/test_data/v6.0/expected_potion.rbi +33 -54
- data/spec/test_data/v6.0/expected_robe.rbi +33 -54
- data/spec/test_data/v6.0/expected_schema_migration.rbi +33 -54
- data/spec/test_data/v6.0/expected_school.rbi +33 -54
- data/spec/test_data/v6.0/expected_spell_book.rbi +46 -52
- data/spec/test_data/v6.0/expected_squib.rbi +42 -54
- data/spec/test_data/v6.0/expected_wand.rbi +47 -52
- data/spec/test_data/v6.0/expected_wizard.rbi +119 -56
- data/spec/test_data/v6.0/expected_wizard_wo_spellbook.rbi +119 -56
- data/spec/typed_enum_spec.rb +55 -0
- data/spec/typed_params_spec.rb +91 -0
- metadata +41 -4
- data/lib/sorbet-rails/model_plugins/active_record_factory_methods.rb +0 -28
@@ -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
|
|
@@ -479,51 +488,6 @@ class Squib < Wizard
|
|
479
488
|
sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
|
480
489
|
def self.extending(*args, &block); end
|
481
490
|
|
482
|
-
sig { params(args: T.untyped).returns(Squib) }
|
483
|
-
def self.find(*args); end
|
484
|
-
|
485
|
-
sig { params(args: T.untyped).returns(T.nilable(Squib)) }
|
486
|
-
def self.find_by(*args); end
|
487
|
-
|
488
|
-
sig { params(args: T.untyped).returns(Squib) }
|
489
|
-
def self.find_by!(*args); end
|
490
|
-
|
491
|
-
sig { returns(T.nilable(Squib)) }
|
492
|
-
def self.first; end
|
493
|
-
|
494
|
-
sig { returns(Squib) }
|
495
|
-
def self.first!; end
|
496
|
-
|
497
|
-
sig { returns(T.nilable(Squib)) }
|
498
|
-
def self.second; end
|
499
|
-
|
500
|
-
sig { returns(Squib) }
|
501
|
-
def self.second!; end
|
502
|
-
|
503
|
-
sig { returns(T.nilable(Squib)) }
|
504
|
-
def self.third; end
|
505
|
-
|
506
|
-
sig { returns(Squib) }
|
507
|
-
def self.third!; end
|
508
|
-
|
509
|
-
sig { returns(T.nilable(Squib)) }
|
510
|
-
def self.third_to_last; end
|
511
|
-
|
512
|
-
sig { returns(Squib) }
|
513
|
-
def self.third_to_last!; end
|
514
|
-
|
515
|
-
sig { returns(T.nilable(Squib)) }
|
516
|
-
def self.second_to_last; end
|
517
|
-
|
518
|
-
sig { returns(Squib) }
|
519
|
-
def self.second_to_last!; end
|
520
|
-
|
521
|
-
sig { returns(T.nilable(Squib)) }
|
522
|
-
def self.last; end
|
523
|
-
|
524
|
-
sig { returns(Squib) }
|
525
|
-
def self.last!; end
|
526
|
-
|
527
491
|
sig { params(conditions: T.untyped).returns(T::Boolean) }
|
528
492
|
def self.exists?(conditions = nil); end
|
529
493
|
|
@@ -538,15 +502,6 @@ class Squib < Wizard
|
|
538
502
|
|
539
503
|
sig { params(args: T.untyped).returns(T::Boolean) }
|
540
504
|
def self.one?(*args); end
|
541
|
-
|
542
|
-
sig { params(attributes: T.untyped, block: T.untyped).returns(Squib) }
|
543
|
-
def self.create(attributes = nil, &block); end
|
544
|
-
|
545
|
-
sig { params(attributes: T.untyped, block: T.untyped).returns(Squib) }
|
546
|
-
def self.create!(attributes = nil, &block); end
|
547
|
-
|
548
|
-
sig { params(attributes: T.untyped, block: T.untyped).returns(Squib) }
|
549
|
-
def self.new(attributes = nil, &block); end
|
550
505
|
end
|
551
506
|
|
552
507
|
class Squib::ActiveRecord_Relation < ActiveRecord::Relation
|
@@ -703,6 +658,21 @@ class Squib::ActiveRecord_Relation < ActiveRecord::Relation
|
|
703
658
|
|
704
659
|
sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Squib::ActiveRecord_Relation) }
|
705
660
|
def extending(*args, &block); end
|
661
|
+
|
662
|
+
sig { params(conditions: T.untyped).returns(T::Boolean) }
|
663
|
+
def exists?(conditions = nil); end
|
664
|
+
|
665
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
666
|
+
def any?(*args); end
|
667
|
+
|
668
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
669
|
+
def many?(*args); end
|
670
|
+
|
671
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
672
|
+
def none?(*args); end
|
673
|
+
|
674
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
675
|
+
def one?(*args); end
|
706
676
|
end
|
707
677
|
|
708
678
|
class Squib::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
|
@@ -869,6 +839,15 @@ class Squib::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelatio
|
|
869
839
|
sig { params(args: T.untyped).returns(Squib) }
|
870
840
|
def find_by!(*args); end
|
871
841
|
|
842
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
|
843
|
+
def find_or_initialize_by(attributes, &block); end
|
844
|
+
|
845
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
|
846
|
+
def find_or_create_by(attributes, &block); end
|
847
|
+
|
848
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
|
849
|
+
def find_or_create_by!(attributes, &block); end
|
850
|
+
|
872
851
|
sig { returns(T.nilable(Squib)) }
|
873
852
|
def first; end
|
874
853
|
|
@@ -1101,6 +1080,15 @@ class Squib::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associati
|
|
1101
1080
|
sig { params(args: T.untyped).returns(Squib) }
|
1102
1081
|
def find_by!(*args); end
|
1103
1082
|
|
1083
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
|
1084
|
+
def find_or_initialize_by(attributes, &block); end
|
1085
|
+
|
1086
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
|
1087
|
+
def find_or_create_by(attributes, &block); end
|
1088
|
+
|
1089
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Squib).void)).returns(Squib) }
|
1090
|
+
def find_or_create_by!(attributes, &block); end
|
1091
|
+
|
1104
1092
|
sig { returns(T.nilable(Squib)) }
|
1105
1093
|
def first; end
|
1106
1094
|
|
@@ -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
|
|
@@ -311,50 +321,11 @@ class Wand < ApplicationRecord
|
|
311
321
|
sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_Relation) }
|
312
322
|
def self.extending(*args, &block); end
|
313
323
|
|
314
|
-
sig {
|
315
|
-
def
|
316
|
-
|
317
|
-
sig { params(args: T.untyped).returns(T.nilable(Wand)) }
|
318
|
-
def self.find_by(*args); end
|
319
|
-
|
320
|
-
sig { params(args: T.untyped).returns(Wand) }
|
321
|
-
def self.find_by!(*args); end
|
322
|
-
|
323
|
-
sig { returns(T.nilable(Wand)) }
|
324
|
-
def self.first; end
|
325
|
-
|
326
|
-
sig { returns(Wand) }
|
327
|
-
def self.first!; end
|
328
|
-
|
329
|
-
sig { returns(T.nilable(Wand)) }
|
330
|
-
def self.second; end
|
331
|
-
|
332
|
-
sig { returns(Wand) }
|
333
|
-
def self.second!; end
|
334
|
-
|
335
|
-
sig { returns(T.nilable(Wand)) }
|
336
|
-
def self.third; end
|
337
|
-
|
338
|
-
sig { returns(Wand) }
|
339
|
-
def self.third!; end
|
340
|
-
|
341
|
-
sig { returns(T.nilable(Wand)) }
|
342
|
-
def self.third_to_last; end
|
343
|
-
|
344
|
-
sig { returns(Wand) }
|
345
|
-
def self.third_to_last!; end
|
346
|
-
|
347
|
-
sig { returns(T.nilable(Wand)) }
|
348
|
-
def self.second_to_last; end
|
349
|
-
|
350
|
-
sig { returns(Wand) }
|
351
|
-
def self.second_to_last!; end
|
352
|
-
|
353
|
-
sig { returns(T.nilable(Wand)) }
|
354
|
-
def self.last; end
|
324
|
+
sig { returns(T.nilable(Wand::CoreType)) }
|
325
|
+
def typed_core_type; end
|
355
326
|
|
356
|
-
sig {
|
357
|
-
def
|
327
|
+
sig { params(value: T.nilable(Wand::CoreType)).void }
|
328
|
+
def typed_core_type=(value); end
|
358
329
|
|
359
330
|
sig { params(conditions: T.untyped).returns(T::Boolean) }
|
360
331
|
def self.exists?(conditions = nil); end
|
@@ -371,15 +342,6 @@ class Wand < ApplicationRecord
|
|
371
342
|
sig { params(args: T.untyped).returns(T::Boolean) }
|
372
343
|
def self.one?(*args); end
|
373
344
|
|
374
|
-
sig { params(attributes: T.untyped, block: T.untyped).returns(Wand) }
|
375
|
-
def self.create(attributes = nil, &block); end
|
376
|
-
|
377
|
-
sig { params(attributes: T.untyped, block: T.untyped).returns(Wand) }
|
378
|
-
def self.create!(attributes = nil, &block); end
|
379
|
-
|
380
|
-
sig { params(attributes: T.untyped, block: T.untyped).returns(Wand) }
|
381
|
-
def self.new(attributes = nil, &block); end
|
382
|
-
|
383
345
|
sig { returns(T::Array[Wand]) }
|
384
346
|
def self.mythicals; end
|
385
347
|
end
|
@@ -490,6 +452,21 @@ class Wand::ActiveRecord_Relation < ActiveRecord::Relation
|
|
490
452
|
|
491
453
|
sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Wand::ActiveRecord_Relation) }
|
492
454
|
def extending(*args, &block); end
|
455
|
+
|
456
|
+
sig { params(conditions: T.untyped).returns(T::Boolean) }
|
457
|
+
def exists?(conditions = nil); end
|
458
|
+
|
459
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
460
|
+
def any?(*args); end
|
461
|
+
|
462
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
463
|
+
def many?(*args); end
|
464
|
+
|
465
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
466
|
+
def none?(*args); end
|
467
|
+
|
468
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
469
|
+
def one?(*args); end
|
493
470
|
end
|
494
471
|
|
495
472
|
class Wand::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
|
@@ -608,6 +585,15 @@ class Wand::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
|
|
608
585
|
sig { params(args: T.untyped).returns(Wand) }
|
609
586
|
def find_by!(*args); end
|
610
587
|
|
588
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
|
589
|
+
def find_or_initialize_by(attributes, &block); end
|
590
|
+
|
591
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
|
592
|
+
def find_or_create_by(attributes, &block); end
|
593
|
+
|
594
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
|
595
|
+
def find_or_create_by!(attributes, &block); end
|
596
|
+
|
611
597
|
sig { returns(T.nilable(Wand)) }
|
612
598
|
def first; end
|
613
599
|
|
@@ -792,6 +778,15 @@ class Wand::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associatio
|
|
792
778
|
sig { params(args: T.untyped).returns(Wand) }
|
793
779
|
def find_by!(*args); end
|
794
780
|
|
781
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
|
782
|
+
def find_or_initialize_by(attributes, &block); end
|
783
|
+
|
784
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
|
785
|
+
def find_or_create_by(attributes, &block); end
|
786
|
+
|
787
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wand).void)).returns(Wand) }
|
788
|
+
def find_or_create_by!(attributes, &block); end
|
789
|
+
|
795
790
|
sig { returns(T.nilable(Wand)) }
|
796
791
|
def first; end
|
797
792
|
|
@@ -116,12 +116,6 @@ end
|
|
116
116
|
module Wizard::GeneratedAttributeMethods
|
117
117
|
extend T::Sig
|
118
118
|
|
119
|
-
sig { returns(T.nilable(String)) }
|
120
|
-
def broom; end
|
121
|
-
|
122
|
-
sig { params(value: T.nilable(T.any(Integer, String, Symbol))).void }
|
123
|
-
def broom=(value); end
|
124
|
-
|
125
119
|
sig { returns(T::Boolean) }
|
126
120
|
def broom?; end
|
127
121
|
|
@@ -161,12 +155,6 @@ module Wizard::GeneratedAttributeMethods
|
|
161
155
|
sig { returns(T::Boolean) }
|
162
156
|
def hair_length?; end
|
163
157
|
|
164
|
-
sig { returns(T.nilable(String)) }
|
165
|
-
def house; end
|
166
|
-
|
167
|
-
sig { params(value: T.nilable(T.any(Integer, String, Symbol))).void }
|
168
|
-
def house=(value); end
|
169
|
-
|
170
158
|
sig { returns(T::Boolean) }
|
171
159
|
def house?; end
|
172
160
|
|
@@ -207,10 +195,13 @@ module Wizard::GeneratedAttributeMethods
|
|
207
195
|
def parent_email?; end
|
208
196
|
|
209
197
|
sig { returns(T.nilable(String)) }
|
210
|
-
def
|
198
|
+
def professor; end
|
211
199
|
|
212
200
|
sig { params(value: T.nilable(T.any(Integer, String, Symbol))).void }
|
213
|
-
def
|
201
|
+
def professor=(value); end
|
202
|
+
|
203
|
+
sig { returns(T::Boolean) }
|
204
|
+
def professor?; end
|
214
205
|
|
215
206
|
sig { returns(T::Boolean) }
|
216
207
|
def quidditch_position?; end
|
@@ -243,6 +234,63 @@ module Wizard::GeneratedAttributeMethods
|
|
243
234
|
def updated_at?; end
|
244
235
|
end
|
245
236
|
|
237
|
+
class Wizard::Broom < T::Enum
|
238
|
+
enums do
|
239
|
+
Nimbus = new('nimbus')
|
240
|
+
Firebolt = new('firebolt')
|
241
|
+
end
|
242
|
+
|
243
|
+
end
|
244
|
+
|
245
|
+
class Wizard::EyeColor < T::Enum
|
246
|
+
enums do
|
247
|
+
Brown = new('brown')
|
248
|
+
Green = new('green')
|
249
|
+
Blue = new('blue')
|
250
|
+
end
|
251
|
+
|
252
|
+
end
|
253
|
+
|
254
|
+
class Wizard::HairColor < T::Enum
|
255
|
+
enums do
|
256
|
+
Brown = new('brown')
|
257
|
+
Black = new('black')
|
258
|
+
Blonde = new('blonde')
|
259
|
+
end
|
260
|
+
|
261
|
+
end
|
262
|
+
|
263
|
+
class Wizard::House < T::Enum
|
264
|
+
enums do
|
265
|
+
Gryffindor = new('Gryffindor')
|
266
|
+
Hufflepuff = new('Hufflepuff')
|
267
|
+
Ravenclaw = new('Ravenclaw')
|
268
|
+
Slytherin = new('Slytherin')
|
269
|
+
end
|
270
|
+
|
271
|
+
end
|
272
|
+
|
273
|
+
class Wizard::ProfessorEnum < T::Enum
|
274
|
+
enums do
|
275
|
+
SeverusSnape = new('Severus Snape')
|
276
|
+
MinervaMcGonagall = new('Minerva McGonagall')
|
277
|
+
PomonaSprout = new('Pomona Sprout')
|
278
|
+
FiliusFlitwick = new('Filius Flitwick')
|
279
|
+
Hagrid = new('Hagrid')
|
280
|
+
end
|
281
|
+
|
282
|
+
end
|
283
|
+
|
284
|
+
class Wizard::QuidditchPosition < T::Enum
|
285
|
+
enums do
|
286
|
+
Keeper = new('keeper')
|
287
|
+
Seeker = new('seeker')
|
288
|
+
Beater = new('beater')
|
289
|
+
Chaser = new('chaser')
|
290
|
+
end
|
291
|
+
|
292
|
+
end
|
293
|
+
|
246
294
|
module Wizard::GeneratedAssociationMethods
|
247
295
|
extend T::Sig
|
248
296
|
|
@@ -479,50 +527,41 @@ class Wizard < ApplicationRecord
|
|
479
527
|
sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Wizard::ActiveRecord_Relation) }
|
480
528
|
def self.extending(*args, &block); end
|
481
529
|
|
482
|
-
sig {
|
483
|
-
def
|
484
|
-
|
485
|
-
sig { params(args: T.untyped).returns(T.nilable(Wizard)) }
|
486
|
-
def self.find_by(*args); end
|
487
|
-
|
488
|
-
sig { params(args: T.untyped).returns(Wizard) }
|
489
|
-
def self.find_by!(*args); end
|
530
|
+
sig { returns(T.nilable(Wizard::Broom)) }
|
531
|
+
def typed_broom; end
|
490
532
|
|
491
|
-
sig {
|
492
|
-
def
|
533
|
+
sig { params(value: T.nilable(Wizard::Broom)).void }
|
534
|
+
def typed_broom=(value); end
|
493
535
|
|
494
|
-
sig { returns(Wizard) }
|
495
|
-
def
|
536
|
+
sig { returns(T.nilable(Wizard::EyeColor)) }
|
537
|
+
def typed_eye_color; end
|
496
538
|
|
497
|
-
sig {
|
498
|
-
def
|
539
|
+
sig { params(value: T.nilable(Wizard::EyeColor)).void }
|
540
|
+
def typed_eye_color=(value); end
|
499
541
|
|
500
|
-
sig { returns(Wizard) }
|
501
|
-
def
|
542
|
+
sig { returns(T.nilable(Wizard::HairColor)) }
|
543
|
+
def typed_hair_color; end
|
502
544
|
|
503
|
-
sig {
|
504
|
-
def
|
545
|
+
sig { params(value: T.nilable(Wizard::HairColor)).void }
|
546
|
+
def typed_hair_color=(value); end
|
505
547
|
|
506
|
-
sig { returns(Wizard) }
|
507
|
-
def
|
548
|
+
sig { returns(T.nilable(Wizard::House)) }
|
549
|
+
def typed_house; end
|
508
550
|
|
509
|
-
sig {
|
510
|
-
def
|
551
|
+
sig { params(value: T.nilable(Wizard::House)).void }
|
552
|
+
def typed_house=(value); end
|
511
553
|
|
512
|
-
sig { returns(Wizard) }
|
513
|
-
def
|
554
|
+
sig { returns(T.nilable(Wizard::ProfessorEnum)) }
|
555
|
+
def typed_professor; end
|
514
556
|
|
515
|
-
sig {
|
516
|
-
def
|
557
|
+
sig { params(value: T.nilable(Wizard::ProfessorEnum)).void }
|
558
|
+
def typed_professor=(value); end
|
517
559
|
|
518
|
-
sig { returns(Wizard) }
|
519
|
-
def
|
560
|
+
sig { returns(T.nilable(Wizard::QuidditchPosition)) }
|
561
|
+
def typed_quidditch_position; end
|
520
562
|
|
521
|
-
sig {
|
522
|
-
def
|
523
|
-
|
524
|
-
sig { returns(Wizard) }
|
525
|
-
def self.last!; end
|
563
|
+
sig { params(value: T.nilable(Wizard::QuidditchPosition)).void }
|
564
|
+
def typed_quidditch_position=(value); end
|
526
565
|
|
527
566
|
sig { params(conditions: T.untyped).returns(T::Boolean) }
|
528
567
|
def self.exists?(conditions = nil); end
|
@@ -538,15 +577,6 @@ class Wizard < ApplicationRecord
|
|
538
577
|
|
539
578
|
sig { params(args: T.untyped).returns(T::Boolean) }
|
540
579
|
def self.one?(*args); end
|
541
|
-
|
542
|
-
sig { params(attributes: T.untyped, block: T.untyped).returns(Wizard) }
|
543
|
-
def self.create(attributes = nil, &block); end
|
544
|
-
|
545
|
-
sig { params(attributes: T.untyped, block: T.untyped).returns(Wizard) }
|
546
|
-
def self.create!(attributes = nil, &block); end
|
547
|
-
|
548
|
-
sig { params(attributes: T.untyped, block: T.untyped).returns(Wizard) }
|
549
|
-
def self.new(attributes = nil, &block); end
|
550
580
|
end
|
551
581
|
|
552
582
|
class Wizard::ActiveRecord_Relation < ActiveRecord::Relation
|
@@ -703,6 +733,21 @@ class Wizard::ActiveRecord_Relation < ActiveRecord::Relation
|
|
703
733
|
|
704
734
|
sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(Wizard::ActiveRecord_Relation) }
|
705
735
|
def extending(*args, &block); end
|
736
|
+
|
737
|
+
sig { params(conditions: T.untyped).returns(T::Boolean) }
|
738
|
+
def exists?(conditions = nil); end
|
739
|
+
|
740
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
741
|
+
def any?(*args); end
|
742
|
+
|
743
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
744
|
+
def many?(*args); end
|
745
|
+
|
746
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
747
|
+
def none?(*args); end
|
748
|
+
|
749
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
750
|
+
def one?(*args); end
|
706
751
|
end
|
707
752
|
|
708
753
|
class Wizard::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
|
@@ -869,6 +914,15 @@ class Wizard::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelati
|
|
869
914
|
sig { params(args: T.untyped).returns(Wizard) }
|
870
915
|
def find_by!(*args); end
|
871
916
|
|
917
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wizard).void)).returns(Wizard) }
|
918
|
+
def find_or_initialize_by(attributes, &block); end
|
919
|
+
|
920
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wizard).void)).returns(Wizard) }
|
921
|
+
def find_or_create_by(attributes, &block); end
|
922
|
+
|
923
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wizard).void)).returns(Wizard) }
|
924
|
+
def find_or_create_by!(attributes, &block); end
|
925
|
+
|
872
926
|
sig { returns(T.nilable(Wizard)) }
|
873
927
|
def first; end
|
874
928
|
|
@@ -1101,6 +1155,15 @@ class Wizard::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associat
|
|
1101
1155
|
sig { params(args: T.untyped).returns(Wizard) }
|
1102
1156
|
def find_by!(*args); end
|
1103
1157
|
|
1158
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wizard).void)).returns(Wizard) }
|
1159
|
+
def find_or_initialize_by(attributes, &block); end
|
1160
|
+
|
1161
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wizard).void)).returns(Wizard) }
|
1162
|
+
def find_or_create_by(attributes, &block); end
|
1163
|
+
|
1164
|
+
sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: Wizard).void)).returns(Wizard) }
|
1165
|
+
def find_or_create_by!(attributes, &block); end
|
1166
|
+
|
1104
1167
|
sig { returns(T.nilable(Wizard)) }
|
1105
1168
|
def first; end
|
1106
1169
|
|