Fix deprecation warning related to #reload

This fixes:

```
DEPRECATION WARNING: Passing an argument to force an association to
reload is now deprecated and will be removed in Rails 5.1. Please call
`reload` on the result collection proxy instead. (called from
can_own_more_enterprises? at /usr/src/app/app/models/spree/user.rb:112)
```

This method in particular gets called a lot of times so it'll have it's
cost in performance.
This commit is contained in:
Pau Perez
2021-03-15 12:24:54 +01:00
parent fbc0d8f352
commit 6fae80bb04

View File

@@ -109,7 +109,7 @@ module Spree
end
def can_own_more_enterprises?
owned_enterprises(:reload).size < enterprise_limit
owned_enterprises.reload.size < enterprise_limit
end
def default_card