Add explicit select statement to prevent scope being read only

This commit is contained in:
Rob Harrington
2014-11-06 15:54:59 +11:00
parent 93e3d87fcb
commit be042af751

View File

@@ -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
}