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.
11 lines
348 B
11 lines
348 B
2 years ago
|
module Validations::Sales::PropertyInformationValidations
|
||
|
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
|
||
|
end
|