mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-14 04:04:23 +00:00
Add explicit select statement to prevent scope being read only
This commit is contained in:
@@ -137,7 +137,7 @@ class Enterprise < ActiveRecord::Base
|
||||
if user.has_spree_role?('admin')
|
||||
scoped
|
||||
else
|
||||
joins(:enterprise_roles).where('enterprise_roles.user_id = ?', user.id)
|
||||
joins(:enterprise_roles).where('enterprise_roles.user_id = ?', user.id).select("DISTINCT enterprises.*")
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user