replaces length 9 validation by format validation: only numbers, spaces and plus sign allowed
This commit is contained in:
@@ -4,7 +4,7 @@ class Verification::Sms
|
||||
attr_accessor :user, :phone, :confirmation_code
|
||||
|
||||
validates_presence_of :phone
|
||||
validates :phone, length: { is: 9 }
|
||||
validates :phone, format: { with: /\A[\d \+]+\z/ }
|
||||
validate :uniqness_phone
|
||||
|
||||
def uniqness_phone
|
||||
|
||||
Reference in New Issue
Block a user