When viewing enterprise fees, only show those for the enterprise I select

This commit is contained in:
Rohan Mitchell
2013-10-18 14:44:01 +11:00
parent 91f14dcd4c
commit ea17e475a6
4 changed files with 39 additions and 6 deletions

View File

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