mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-04 22:16:08 +00:00
Update app/controllers/admin/enterprises_controller.rb
Simplify code Co-authored-by: Maikel <maikel@email.org.au>
This commit is contained in:
committed by
GitHub
parent
e44a0092ea
commit
e7a52e4733
@@ -270,9 +270,7 @@ module Admin
|
||||
end
|
||||
|
||||
def update_vouchers
|
||||
params[:enterprise][:voucher_ids] = [] if params[:enterprise][:voucher_ids].blank?
|
||||
|
||||
params_voucher_ids = params[:enterprise][:voucher_ids].map(&:to_i)
|
||||
params_voucher_ids = params[:enterprise][:voucher_ids].to_a.map(&:to_i)
|
||||
voucher_ids = @enterprise.vouchers.map(&:id)
|
||||
deleted_voucher_ids = @enterprise.vouchers.only_deleted.map(&:id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user