From ce7d9be633e5d4cb8e95ff051dcd495710b7edaf Mon Sep 17 00:00:00 2001 From: Jordan Brough Date: Thu, 6 Oct 2022 22:52:33 -0600 Subject: [PATCH] Fix "presence" checks in Channel::TwilioSms (#5206) --- app/models/channel/twilio_sms.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/channel/twilio_sms.rb b/app/models/channel/twilio_sms.rb index f575b75a0..d6c9177fb 100644 --- a/app/models/channel/twilio_sms.rb +++ b/app/models/channel/twilio_sms.rb @@ -28,8 +28,8 @@ class Channel::TwilioSms < ApplicationRecord validates :auth_token, presence: true # 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 :phone_number, absence: true, if: :messaging_service_sid.presence + validates :messaging_service_sid, uniqueness: true, presence: true, unless: :phone_number? + validates :phone_number, absence: true, if: :messaging_service_sid? validates :phone_number, uniqueness: true, allow_nil: true enum medium: { sms: 0, whatsapp: 1 }