You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
380 B
10 lines
380 B
2 years ago
|
module Validations::Sales::HouseholdValidations
|
||
|
def validate_number_of_other_people_living_in_the_property(record)
|
||
|
return if record.hholdcount.blank?
|
||
|
|
||
|
unless record.hholdcount >= 0 && record.hholdcount <= 4
|
||
|
record.errors.add :hholdcount, I18n.t("validations.numeric.valid", field: "Number of other people living in the property", min: 0, max: 4)
|
||
|
end
|
||
|
end
|
||
|
end
|