You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a way to temporarily opt-out to #all now lazily making requests:
- ### Problem
In 9372d5a we made a change that
defer the http request submission until the collection is used.
```ruby
# Before
Product.all #=> HTTP request is made
# After
products = Product.all #=> No HTTP request is made
products.each { ... } #=> HTTP request is made here
```
This create issues for codepaths that used to expect the
`Product.all` to make the http request and this feels like
a breaking change that should go through a deprecation cycle
(too late now but let's have a way to opt-out to the new behaviour).
### Context
We have a safety net in our application that does something like
this:
```ruby
products = allow_explicit_http_connections do
Product.all
end
products.each { ... }
```
This is now broken because we make the request outside of the
explictly allowed resiliency block.
### Solution
Introduce a way to opt out to the new behaviour and trigger a
deprecation warning.
0 commit comments