|
|
|
|
@ -50,14 +50,6 @@ module Validations::PropertyValidations
|
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def validate_property_postcode(record) |
|
|
|
|
postcode = record.postcode_full |
|
|
|
|
if record.postcode_known? && (postcode.blank? || !postcode.match(POSTCODE_REGEXP)) |
|
|
|
|
error_message = I18n.t("validations.postcode") |
|
|
|
|
record.errors.add :postcode_full, error_message |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def validate_shared_housing_rooms(record) |
|
|
|
|
if record.beds.present? && record.beds <= 0 |
|
|
|
|
record.errors.add :beds, I18n.t("validations.property.beds.non_positive") |
|
|
|
|
|