mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
I removed the caching of `managed_enterprises` in Permissions because it's just a scope and calling it again is very cheap. And that makes the method a lot easier to read now that we have a conditional here. Accessing the managed enterprises via the user instead of a separate scope on the Enterprise model also reduce the SQL queries. We may want to use this method in more places. I prefer to keep the admin-conditional in a permissions class instead of in the model.