Browse Source

change a variable name and correct minor rebase errors

pull/1101/head
Arthur Campbell 3 years ago
parent
commit
89bf3d1f13
  1. 4
      app/helpers/interruption_screen_helper.rb
  2. 6
      app/models/form/sales/pages/about_price_shared_ownership_value_check.rb
  3. 4
      app/models/form/sales/pages/buyer1_income_value_check.rb
  4. 4
      app/models/form/sales/pages/buyer2_income_value_check.rb
  5. 14
      app/models/validations/shared_validations.rb

4
app/helpers/interruption_screen_helper.rb

@ -34,8 +34,8 @@ private
def get_value_from_argument(log, argument) def get_value_from_argument(log, argument)
if argument["label"] if argument["label"]
log.form.get_question(argument["key"], log).answer_label(log).downcase log.form.get_question(argument["key"], log).answer_label(log).downcase
elsif argument["arguments_for_public_send"] elsif argument["arguments_for_key"]
log.public_send(argument["key"], argument["arguments_for_public_send"]) log.public_send(argument["key"], argument["arguments_for_key"])
else else
log.public_send(argument["key"]) log.public_send(argument["key"])
end end

6
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", "translation" => "soft_validations.purchase_price.hint_text",
"arguments" => [ "arguments" => [
{ {
"key" => "purchase_price_soft_min_or_soft_max", "key" => "field_formatted_as_currency",
"label" => false, "arguments_for_key" => "purchase_price_soft_min_or_soft_max",
"i18n_template" => "soft_min_or_soft_max", "i18n_template" => "soft_min_or_soft_max",
"currency" => true,
}, },
{ {
"key" => "purchase_price_min_or_max_text", "key" => "purchase_price_min_or_max_text",
"label" => false,
"i18n_template" => "min_or_max", "i18n_template" => "min_or_max",
}, },
], ],

4
app/models/form/sales/pages/buyer1_income_value_check.rb

@ -11,12 +11,12 @@ class Form::Sales::Pages::Buyer1IncomeValueCheck < ::Form::Page
"arguments" => [ "arguments" => [
{ {
"key" => "field_formatted_as_currency", "key" => "field_formatted_as_currency",
"arguments_for_public_send" => "income1", "arguments_for_key" => "income1",
"i18n_template" => "income", "i18n_template" => "income",
}, },
{ {
"key" => "income_soft_min_for_ecstat", "key" => "income_soft_min_for_ecstat",
"arguments_for_public_send" => "ecstat1", "arguments_for_key" => "ecstat1",
"i18n_template" => "minimum", "i18n_template" => "minimum",
}, },
], ],

4
app/models/form/sales/pages/buyer2_income_value_check.rb

@ -14,12 +14,12 @@ class Form::Sales::Pages::Buyer2IncomeValueCheck < ::Form::Page
"arguments" => [ "arguments" => [
{ {
"key" => "field_formatted_as_currency", "key" => "field_formatted_as_currency",
"arguments_for_public_send" => "income2", "arguments_for_key" => "income2",
"i18n_template" => "income", "i18n_template" => "income",
}, },
{ {
"key" => "income_soft_min_for_ecstat", "key" => "income_soft_min_for_ecstat",
"arguments_for_public_send" => "ecstat2", "arguments_for_key" => "ecstat2",
"i18n_template" => "minimum", "i18n_template" => "minimum",
}, },
], ],

14
app/models/validations/shared_validations.rb

@ -108,20 +108,6 @@ module Validations::SharedValidations
end end
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 private
def person_is_partner?(relationship) def person_is_partner?(relationship)

Loading…
Cancel
Save