sorbet-runtime 0.5.9265 → 0.5.9279

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/types/props/decorator.rb +2 -44
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b52db74c71b24507f2db2379bc55dea9c8ec1d58b398125b24fbc0f7c58bb32
4
- data.tar.gz: 66b9b653df351958e03e5a79cba712667e56aa301ad4d491ecc7a1d967cc21ae
3
+ metadata.gz: 97e70ccff1ad31b25ca778b170ed78fc295fbfd64293fce5b40fbddf2eab7393
4
+ data.tar.gz: 02d10f5a30930ed5dae32d9e6dd24f1dab1baf5981f2c008f6d7f1fdad109ea5
5
5
  SHA512:
6
- metadata.gz: edd169f69038e211dc74a436a2e018a8432c6bb871b55c2e2f94140df73a28d27c6f40e32855e05855cf9d23f42c36b025a8381339688c87a550d2fffe698fe1
7
- data.tar.gz: 54b5a6b1cc0ce42923035612b912011ff4a0f52668193ae494f67f7e73c51d3cd4bf8405143e2876b375f4c106e96b4ecb7c69d7c8ab3e98e481d647bdb847f8
6
+ metadata.gz: caf8dece46b93623a080f58da1aaa7e7ef193529254d59dad18dfea48cf77d42eb7fd801bc608a104ca05b138b79f896fae55adc9a24e10142f2aadd6d090077
7
+ data.tar.gz: bfd44f7636f86e8d10055887dfb1cc95fbe17d4600c9e4c35f929f52f83e13b49b58d6a610c468d494b16b1bb346f40aa0147485dea2712448128d152b22e54a
@@ -61,7 +61,6 @@ class T::Props::Decorator
61
61
  VALID_RULE_KEYS = T.let(%i[
62
62
  enum
63
63
  foreign
64
- foreign_hint_only
65
64
  ifunset
66
65
  immutable
67
66
  override
@@ -359,12 +358,7 @@ class T::Props::Decorator
359
358
  # get at the property (e.g., Chalk::ODM::Document exposes `get` and `set`).
360
359
  define_getter_and_setter(name, rules) unless rules[:without_accessors]
361
360
 
362
- if rules[:foreign] && rules[:foreign_hint_only]
363
- raise ArgumentError.new(":foreign and :foreign_hint_only are mutually exclusive.")
364
- end
365
-
366
361
  handle_foreign_option(name, cls, rules, rules[:foreign]) if rules[:foreign]
367
- handle_foreign_hint_only_option(name, cls, rules[:foreign_hint_only]) if rules[:foreign_hint_only]
368
362
  handle_redaction_option(name, rules[:redaction]) if rules[:redaction]
369
363
  end
370
364
 
@@ -484,42 +478,6 @@ class T::Props::Decorator
484
478
  end
485
479
  end
486
480
 
487
- sig do
488
- params(
489
- prop_name: Symbol,
490
- prop_cls: Module,
491
- foreign_hint_only: T.untyped,
492
- )
493
- .void
494
- end
495
- private def handle_foreign_hint_only_option(prop_name, prop_cls, foreign_hint_only)
496
- if ![String, Array].include?(prop_cls) && !prop_cls.is_a?(T::Props::CustomType)
497
- raise ArgumentError.new(
498
- "`foreign_hint_only` can only be used with String or Array prop types"
499
- )
500
- end
501
-
502
- validate_foreign_option(
503
- :foreign_hint_only, foreign_hint_only,
504
- valid_type_msg: "an individual or array of a model class, or a Proc returning such."
505
- )
506
-
507
- unless foreign_hint_only.is_a?(Proc)
508
- T::Configuration.soft_assert_handler(<<~MESSAGE, storytime: {prop: prop_name, value: foreign_hint_only}, notify: 'jerry')
509
- Please use a Proc that returns a model class instead of the model class itself as the argument to `foreign_hint_only`. In other words:
510
-
511
- instead of `prop :foo, String, foreign_hint_only: FooModel`
512
- use `prop :foo, String, foreign_hint_only: -> {FooModel}`
513
-
514
- OR
515
-
516
- instead of `prop :foo, String, foreign_hint_only: [FooModel, BarModel]`
517
- use `prop :foo, String, foreign_hint_only: -> {[FooModel, BarModel]}`
518
-
519
- MESSAGE
520
- end
521
- end
522
-
523
481
  # checked(:never) - Rules hash is expensive to check
524
482
  sig do
525
483
  params(
@@ -598,8 +556,8 @@ class T::Props::Decorator
598
556
  # keep them from being lurky performance hits by issuing a bunch of un-batched DB queries.
599
557
  # We could potentially address that by porting over something like AmbiguousIDLoader.
600
558
  raise ArgumentError.new(
601
- "Using an array for `foreign` is no longer supported. Instead, use `foreign_hint_only` " \
602
- "with an array or a Proc that returns an array, e.g., foreign_hint_only: -> {[Foo, Bar]}"
559
+ "Using an array for `foreign` is no longer supported. Instead, please use a union type of " \
560
+ "token types for the prop type, e.g., T.any(Opus::Autogen::Tokens::FooModelToken, Opus::Autogen::Tokens::BarModelToken)"
603
561
  )
604
562
  end
605
563
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.9265
4
+ version: 0.5.9279
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-23 00:00:00.000000000 Z
11
+ date: 2021-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest