mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-13 23:37:47 +00:00
When viewing enterprise fees, only show those for the enterprise I select
This commit is contained in:
@@ -51,7 +51,14 @@ module Admin
|
||||
end
|
||||
|
||||
def collection
|
||||
EnterpriseFee.managed_by(spree_current_user).order('enterprise_id', 'fee_type', 'name')
|
||||
collection = EnterpriseFee.managed_by(spree_current_user).order('enterprise_id', 'fee_type', 'name')
|
||||
|
||||
if params.key? :enterprise_id
|
||||
enterprise = Enterprise.find params[:enterprise_id]
|
||||
collection = collection.for_enterprise(enterprise)
|
||||
end
|
||||
|
||||
collection
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user