Merge pull request #8308 from mariodz95/8250_fix_snail_when_editing_non_numeric_characters_on_enterprise_fees

Fix snail when editing non numeric characters on enterprise fees
This commit is contained in:
jibees
2021-10-22 09:14:28 +02:00
committed by GitHub

View File

@@ -35,6 +35,13 @@ module Admin
end
def bulk_update
@flat_percent_value = enterprise_fee_bulk_params.dig('collection_attributes', '0', 'calculator_attributes', 'preferred_flat_percent')
unless @flat_percent_value.nil? || Float(@flat_percent_value, exception: false)
flash[:error] = I18n.t(:calculator_preferred_value_error)
return redirect_to redirect_path
end
@enterprise_fee_set = Sets::EnterpriseFeeSet.new(enterprise_fee_bulk_params)
if @enterprise_fee_set.save