From 9b16c1171fa479c7adb896a7bcba89fa98ea2d21 Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 6 Jul 2023 09:14:37 +1000 Subject: [PATCH] Remove redundant returns The return value of active record validations doesn't actually do anything. A record is 'valid?' if @errors is empty. --- app/units/forms/enterprise_fees_bulk_update.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/units/forms/enterprise_fees_bulk_update.rb b/app/units/forms/enterprise_fees_bulk_update.rb index 44e20a1e10..4142049072 100644 --- a/app/units/forms/enterprise_fees_bulk_update.rb +++ b/app/units/forms/enterprise_fees_bulk_update.rb @@ -36,11 +36,9 @@ module Forms enterprise_fees.each do |_, enterprise_amount| unless enterprise_amount.nil? || Float(enterprise_amount, exception: false) @errors.add(:base, I18n.t(:calculator_preferred_value_error)) - return false end end end - return true end def check_calculators_compatibility_with_taxes @@ -54,9 +52,7 @@ module Forms 'activerecord.errors.models.enterprise_fee.inherit_tax_requires_per_item_calculator' ) ) - return false end - return true end def enterprise_fee_bulk_params