Sha256: 0cb08b44378dbaa1ef80c271e0316e0bc0e7bfe72f8363c9f517df0e4aafcb09

Contents?: true

Size: 815 Bytes

Versions: 33

Compression:

Stored size: 815 Bytes

Contents

# frozen_string_literal: true

#
# Twilio configuration, both fields and methods to determine configuration
#
module TwilioConfiguration
  extend ActiveSupport::Concern
  #
  # The Twilio Configuration
  #
  def self.included(base)
    base.class_eval do
      field :twilio_account_id, type: String
      field :twilio_auth_token, type: String
      field :twilio_phone_number, type: String
    end
  end

  #
  # Make sure the password doesn't get blanked out on an update
  #
  def secure_fields
    super + %i[twilio_auth_token]
  end

  #
  # Determine if twilio is configured at a system configuration
  #
  # Examples
  #
  #   twilio_configured??
  #   # => true || false
  #
  def twilio_configured?
    [twilio_account_id.present?, twilio_auth_token.present?, twilio_phone_number.present?].all?
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
web47core-3.2.20 lib/app/models/concerns/twilio_configuration.rb
web47core-3.2.19 lib/app/models/concerns/twilio_configuration.rb
web47core-3.2.18 lib/app/models/concerns/twilio_configuration.rb
web47core-3.2.17 lib/app/models/concerns/twilio_configuration.rb
web47core-3.2.16 lib/app/models/concerns/twilio_configuration.rb
web47core-3.2.15 lib/app/models/concerns/twilio_configuration.rb
web47core-3.2.14 lib/app/models/concerns/twilio_configuration.rb
web47core-3.2.13 lib/app/models/concerns/twilio_configuration.rb
web47core-3.2.12 lib/app/models/concerns/twilio_configuration.rb
web47core-3.2.9 lib/app/models/concerns/twilio_configuration.rb
web47core-3.2.8 lib/app/models/concerns/twilio_configuration.rb
web47core-3.2.7 lib/app/models/concerns/twilio_configuration.rb
web47core-3.2.6 lib/app/models/concerns/twilio_configuration.rb
web47core-3.2.5 lib/app/models/concerns/twilio_configuration.rb
web47core-3.2.4 lib/app/models/concerns/twilio_configuration.rb
web47core-2.2.20 lib/app/models/concerns/twilio_configuration.rb
web47core-2.2.19 lib/app/models/concerns/twilio_configuration.rb
web47core-3.2.3 lib/app/models/concerns/twilio_configuration.rb
web47core-3.2.2 lib/app/models/concerns/twilio_configuration.rb
web47core-2.2.15 lib/app/models/concerns/twilio_configuration.rb