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.
9 lines
384 B
9 lines
384 B
module Validations::LocalAuthorityValidations |
|
def validate_previous_accommodation_postcode(record) |
|
postcode = record.ppostcode_full |
|
if record.previous_postcode_known? && (postcode.blank? || !postcode.match(POSTCODE_REGEXP)) |
|
error_message = I18n.t("validations.postcode") |
|
record.errors.add :ppostcode_full, :wrong_format, message: error_message |
|
end |
|
end |
|
end
|
|
|