|
|
|
@ -66,7 +66,7 @@ module Validations::TenancyValidations |
|
|
|
def validate_joint_tenancy(record) |
|
|
|
def validate_joint_tenancy(record) |
|
|
|
return unless record.collection_start_year && record.joint |
|
|
|
return unless record.collection_start_year && record.joint |
|
|
|
|
|
|
|
|
|
|
|
if record.hhmemb == 1 && record.joint == 1 && record.collection_start_year >= 2022 |
|
|
|
if record.hhmemb == 1 && record.joint == 1 |
|
|
|
record.errors.add :joint, :not_joint_tenancy, message: I18n.t("validations.lettings.tenancy.joint.sole_tenancy") |
|
|
|
record.errors.add :joint, :not_joint_tenancy, message: I18n.t("validations.lettings.tenancy.joint.sole_tenancy") |
|
|
|
record.errors.add :hhmemb, I18n.t("validations.lettings.tenancy.joint.multiple_members_required") |
|
|
|
record.errors.add :hhmemb, I18n.t("validations.lettings.tenancy.joint.multiple_members_required") |
|
|
|
end |
|
|
|
end |
|
|
|
|