From d430eb4e20941064489f0d34c3099c0eb213c332 Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Wed, 21 Aug 2024 10:15:19 +0100 Subject: [PATCH] CLDC-3577: Validate that phone extension is a number --- app/models/user.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/user.rb b/app/models/user.rb index 2b1c5b9ca..ca8233980 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -19,6 +19,7 @@ class User < ApplicationRecord validates :password, presence: { if: :password_required? } validates :password, length: { within: Devise.password_length, allow_blank: true } validates :password, confirmation: { if: :password_required? } + validates :phone_extension, format: { with: /\A\d+\z/, allow_blank: true, message: I18n.t("validations.numeric.format", field: "") } after_validation :send_data_protection_confirmation_reminder, if: :is_dpo_changed?