does not require phones to be Spanish any more
This commit is contained in:
@@ -5,13 +5,8 @@ class Verification::Sms
|
||||
|
||||
validates_presence_of :phone
|
||||
validates :phone, length: { is: 9 }
|
||||
validate :spanish_phone
|
||||
validate :uniqness_phone
|
||||
|
||||
def spanish_phone
|
||||
errors.add(:phone, :invalid) unless phone.start_with?('6', '7')
|
||||
end
|
||||
|
||||
def uniqness_phone
|
||||
errors.add(:phone, :taken) if User.where(confirmed_phone: phone).any?
|
||||
end
|
||||
@@ -40,4 +35,4 @@ class Verification::Sms
|
||||
def generate_confirmation_code
|
||||
rand.to_s[2..5]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user