Browse Source

rubocop

pull/427/head
Kat 3 years ago
parent
commit
04c9296a7f
  1. 2
      app/models/validations/financial_validations.rb

2
app/models/validations/financial_validations.rb

@ -122,7 +122,7 @@ private
%i[scharge pscharge supcharg].each do |charge| %i[scharge pscharge supcharg].each do |charge|
maximum = CHARGE_MAXIMUMS.dig(charge, LANDLORD_VALUES[record.landlord], NEEDSTYPE_VALUES[record.needstype]) maximum = CHARGE_MAXIMUMS.dig(charge, LANDLORD_VALUES[record.landlord], NEEDSTYPE_VALUES[record.needstype])
if maximum.present? && record[charge].present? && !weekly_value_in_range(record, charge, 0, maximum) if maximum.present? && record[charge].present? && !weekly_value_in_range(record, charge, 0, maximum)
record.errors.add charge, I18n.t("validations.financial.rent.#{charge}.#{LANDLORD_VALUES[record.landlord]}.#{NEEDSTYPE_VALUES[record.needstype]}") record.errors.add charge, I18n.t("validations.financial.rent.#{charge}.#{LANDLORD_VALUES[record.landlord]}.#{NEEDSTYPE_VALUES[record.needstype]}")
end end
end end

Loading…
Cancel
Save