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.
- checksums.yaml +4 -4
- data/README.md +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d365c67d8623f21114d7f79c819d16a7311baa2a556e9cde8e16b6d8bfbd3e6
|
4
|
+
data.tar.gz: fb1f77cfc2ec1b40358af7ac73173d7514a0468fa54b9eb256b0f22fd858f5f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(...)`
|