sorbet-rails 0.7.25 → 0.7.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99ef9d97be5d8b7c9ce91c26827337bb0cf170a704d0e1c025a1a47964b8f0cd
4
- data.tar.gz: 831bc3d6fc4aafd8e0f4ea315369a410b3dbd90669a8bbd5b5f059fe9ce6543b
3
+ metadata.gz: 5d365c67d8623f21114d7f79c819d16a7311baa2a556e9cde8e16b6d8bfbd3e6
4
+ data.tar.gz: fb1f77cfc2ec1b40358af7ac73173d7514a0468fa54b9eb256b0f22fd858f5f1
5
5
  SHA512:
6
- metadata.gz: 7309e5f22a4f7979ff5665c0d17d2c22bf823d9bbb4d6468668d6df0ad5b6e4243a300974e5b289c8314adbfc40f04d889a3d4a69a1d932b443d5ae688a11256
7
- data.tar.gz: '06496c5b1cf2b7e688fb100cba9d3dfae8baded69712b0a8b2e4adfbef27ec93dca88205813776c9905329ac17e118bb871c19a2d6abfbaff1dce006c27eda3d'
6
+ metadata.gz: c2cacbe16f730f4001131ec0e3637903a3dfc8d41a30cbaf4631bb8b29fa4e93f5d3c435f3bd1aaa8d55ce8e61ccd03c3ad3a56c0ad392acad2262f8c0a123ed
7
+ data.tar.gz: 5ece85c111833a7df27853a60d54d8e7015154d7142d2f7a4eb3b75f1ffe638093a9e0ad0c9203cd2f741419f4f943a36f414580213cf1616cd04dc564902ce2
data/README.md CHANGED
@@ -433,6 +433,14 @@ arr = [Model.recent, Model.old].flatten # T::Array[Model::ActiveRecord_Relation]
433
433
  arr = [Model.recent, Model.old].map(&:to_a).flatten # T::Array[Model]
434
434
  ```
435
435
 
436
+ `flat_map` has a similar issue.
437
+
438
+ ```ruby
439
+ foo.bars.flat_map { |b| b.scope } # T::Array[T.untyped]
440
+
441
+ foo.bars.flat_map { |b| b.scope.to_a } # T::Array[Scope]
442
+ ```
443
+
436
444
  ### Avoid `and_call_original` in rspecs
437
445
 
438
446
  If you run into the following issue when running rspec, it's likely because you're using `expect(:method_name).and_call_original` to mock a method in RSpec. We've found the double mock doesn't interact well with Sorbet's sig wrapper and caused flaky spec. The spec should be rewritten to expect the outcome of the method instead. (It still works with `expect(:method_name)` and `expect(:method_name).and_return(...)`
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.25
4
+ version: 0.7.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chan Zuckerberg Initiative