Sha256: 11f28078c786621548d7e2b60309bca094b00fe9d3be9519b4589c89a8160a5c
Contents?: true
Size: 1.25 KB
Versions: 14
Compression:
Stored size: 1.25 KB
Contents
# frozen_string_literal: true # # The System configuration. Various configuration items that can be updated/defined at run time # # Use of this class allows you to simply ask for the configuration parameter directly without # first having to get an instance of it. # # SystemConfiguration.queue_impl #=> 'RedisQueue' # # This method only is allowed for accessors, you should NEVER set values on the SystemConfiguration # unless you are updating via the Admin or Stack UI, or during testing to setup a specific configuration # for that. # module CoreAccount extend ActiveSupport::Concern def self.included(base) base.class_eval do # # Fields # field :name, type: String # # Relationships # has_many :notifications, dependent: :delete do def emails where(_type: 'EmailNotification') end def slacks where(_type: 'SlackNotification') end def sms where(_type: 'SmsNotification') end end has_many :templates, dependent: :delete embeds_one :smtp_configuration end end # # Return or build the smtp configuration for the account # def fetch_smtp_configuration smtp_configuration || build_smtp_configuration end end
Version data entries
14 entries across 14 versions & 1 rubygems