Fix "presence" checks in Channel::TwilioSms (#5206)
This commit is contained in:
parent
788b766179
commit
ce7d9be633
1 changed files with 2 additions and 2 deletions
|
@ -28,8 +28,8 @@ class Channel::TwilioSms < ApplicationRecord
|
||||||
validates :auth_token, presence: true
|
validates :auth_token, presence: true
|
||||||
|
|
||||||
# Must have _one_ of messaging_service_sid _or_ phone_number, and messaging_service_sid is preferred
|
# Must have _one_ of messaging_service_sid _or_ phone_number, and messaging_service_sid is preferred
|
||||||
validates :messaging_service_sid, uniqueness: true, presence: true, unless: :phone_number.presence
|
validates :messaging_service_sid, uniqueness: true, presence: true, unless: :phone_number?
|
||||||
validates :phone_number, absence: true, if: :messaging_service_sid.presence
|
validates :phone_number, absence: true, if: :messaging_service_sid?
|
||||||
validates :phone_number, uniqueness: true, allow_nil: true
|
validates :phone_number, uniqueness: true, allow_nil: true
|
||||||
|
|
||||||
enum medium: { sms: 0, whatsapp: 1 }
|
enum medium: { sms: 0, whatsapp: 1 }
|
||||||
|
|
Loading…
Reference in a new issue