Sha256: 50b44812a374b1aa09c0c5bd5828d585f272216e6c75c6357f312970307a61d7
Contents?: true
Size: 945 Bytes
Versions: 33
Compression:
Stored size: 945 Bytes
Contents
# frozen_string_literal: true # # The Slack Configuration to be used inside of SystemConfiguration # module SlackConfiguration extend ActiveSupport::Concern def self.included(base) base.class_eval do # # Fields # field :slack_api_url, type: String field :slack_support_channel, type: String, default: 'support' field :slack_sales_channel, type: String, default: 'sales' field :slack_notification_ttl, type: Integer, default: 5 # # Validations # validates :slack_api_url, url: true, allow_blank: true validates :slack_support_channel, presence: true validates :slack_sales_channel, presence: true end end # # Determine if Slack is configured # # Examples # # slack_configured?? # # => true || false # def slack_configured? [slack_api_url.present?, slack_support_channel.present?, slack_sales_channel.present?].all? end end
Version data entries
33 entries across 33 versions & 1 rubygems