diff --git a/app/helpers/interruption_screen_helper.rb b/app/helpers/interruption_screen_helper.rb index b4bd3f7cd..939f70bb2 100644 --- a/app/helpers/interruption_screen_helper.rb +++ b/app/helpers/interruption_screen_helper.rb @@ -34,8 +34,8 @@ private def get_value_from_argument(log, argument) if argument["label"] log.form.get_question(argument["key"], log).answer_label(log).downcase - elsif argument["arguments_for_public_send"] - log.public_send(argument["key"], argument["arguments_for_public_send"]) + elsif argument["arguments_for_key"] + log.public_send(argument["key"], argument["arguments_for_key"]) else log.public_send(argument["key"]) end diff --git a/app/models/form/sales/pages/about_price_shared_ownership_value_check.rb b/app/models/form/sales/pages/about_price_shared_ownership_value_check.rb index f4f0955cd..5b668006a 100644 --- a/app/models/form/sales/pages/about_price_shared_ownership_value_check.rb +++ b/app/models/form/sales/pages/about_price_shared_ownership_value_check.rb @@ -20,14 +20,12 @@ class Form::Sales::Pages::AboutPriceSharedOwnershipValueCheck < ::Form::Page "translation" => "soft_validations.purchase_price.hint_text", "arguments" => [ { - "key" => "purchase_price_soft_min_or_soft_max", - "label" => false, + "key" => "field_formatted_as_currency", + "arguments_for_key" => "purchase_price_soft_min_or_soft_max", "i18n_template" => "soft_min_or_soft_max", - "currency" => true, }, { "key" => "purchase_price_min_or_max_text", - "label" => false, "i18n_template" => "min_or_max", }, ], diff --git a/app/models/form/sales/pages/buyer1_income_value_check.rb b/app/models/form/sales/pages/buyer1_income_value_check.rb index ab1edb936..48d8f5fff 100644 --- a/app/models/form/sales/pages/buyer1_income_value_check.rb +++ b/app/models/form/sales/pages/buyer1_income_value_check.rb @@ -11,12 +11,12 @@ class Form::Sales::Pages::Buyer1IncomeValueCheck < ::Form::Page "arguments" => [ { "key" => "field_formatted_as_currency", - "arguments_for_public_send" => "income1", + "arguments_for_key" => "income1", "i18n_template" => "income", }, { "key" => "income_soft_min_for_ecstat", - "arguments_for_public_send" => "ecstat1", + "arguments_for_key" => "ecstat1", "i18n_template" => "minimum", }, ], diff --git a/app/models/form/sales/pages/buyer2_income_value_check.rb b/app/models/form/sales/pages/buyer2_income_value_check.rb index 8037dc20a..598c4c7a6 100644 --- a/app/models/form/sales/pages/buyer2_income_value_check.rb +++ b/app/models/form/sales/pages/buyer2_income_value_check.rb @@ -14,12 +14,12 @@ class Form::Sales::Pages::Buyer2IncomeValueCheck < ::Form::Page "arguments" => [ { "key" => "field_formatted_as_currency", - "arguments_for_public_send" => "income2", + "arguments_for_key" => "income2", "i18n_template" => "income", }, { "key" => "income_soft_min_for_ecstat", - "arguments_for_public_send" => "ecstat2", + "arguments_for_key" => "ecstat2", "i18n_template" => "minimum", }, ], diff --git a/app/models/validations/shared_validations.rb b/app/models/validations/shared_validations.rb index bffd6daa2..32a8b22bd 100644 --- a/app/models/validations/shared_validations.rb +++ b/app/models/validations/shared_validations.rb @@ -108,20 +108,6 @@ module Validations::SharedValidations end end - def validate_child_income(record) - return unless record.income2 && (record.relat2 || record.ecstat2) - - if record.income2.positive? - if is_relationship_child? record.relat2 - record.errors.add :relat2, I18n.t("validations.financial.income.child_has_income") - record.errors.add :income2, I18n.t("validations.financial.income.child_has_income") - elsif is_economic_status_child? record.ecstat2 - record.errors.add :ecstat2, I18n.t("validations.financial.income.child_has_income") - record.errors.add :income2, I18n.t("validations.financial.income.child_has_income") - end - end - end - private def person_is_partner?(relationship)