|
|
@ -34,8 +34,11 @@ module Validations::TenancyValidations |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def validate_joint_tenancy(record) |
|
|
|
def validate_joint_tenancy(record) |
|
|
|
if record.hhmemb == 1 && record.joint != 2 && record.collection_start_year == 2022 |
|
|
|
if !record.collection_start_year.blank? |
|
|
|
|
|
|
|
if record.hhmemb == 1 && record.joint != 2 && record.collection_start_year >= 2022 |
|
|
|
record.errors.add :joint, I18n.t("validations.tenancy.not_joint") |
|
|
|
record.errors.add :joint, I18n.t("validations.tenancy.not_joint") |
|
|
|
|
|
|
|
record.errors.add :hhmemb, I18n.t("validations.tenancy.not_joint") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|