fix rubocop errors

This commit is contained in:
Viehlieb 2021-12-24 13:35:26 +01:00
parent 09679812af
commit bafa163ce5
8 changed files with 107 additions and 115 deletions

View file

@ -9,9 +9,11 @@ class GroupOrderInvoicesController < ApplicationController
send_group_order_invoice_pdf @group_order_invoice if FoodsoftConfig[:contact][:tax_number]
end
end
else raise RecordInvalid
redirect_back fallback_location: root_path, notice: 'Something went wrong', :alert => I18n.t('errors.general_msg', :msg => "#{error} " + I18n.t('errors.check_tax_number'))
else
raise RecordInvalid
end
rescue => error
redirect_back fallback_location: root_path, notice: 'Something went wrong', alert: I18n.t('errors.general_msg', msg: "#{error} " + I18n.t('errors.check_tax_number'))
end
def destroy
@ -27,7 +29,7 @@ class GroupOrderInvoicesController < ApplicationController
def create
go = GroupOrder.find(params[:group_order])
@order = go.order
goi = GroupOrderInvoice.find_or_create_by!(group_order_id: go.id)
GroupOrderInvoice.find_or_create_by!(group_order_id: go.id)
respond_to do |format|
format.js
end
@ -35,4 +37,4 @@ class GroupOrderInvoicesController < ApplicationController
rescue => error
redirect_back fallback_location: root_path, notice: 'Something went wrong', :alert => I18n.t('errors.general_msg', :msg => error)
end
end
end