Browse Source
Introduces new database fields and fixes rubocop issuesCLDC-1468-add-postcode-to-sales-property-info-journey
Mo Seedat
2 years ago
8 changed files with 111 additions and 13 deletions
@ -0,0 +1,10 @@
|
||||
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 |
Loading…
Reference in new issue