Sha256: dc49c23f78f9bd4c579a9873a42935a4eb0f782157222b24977eb96d15400ef4
Contents?: true
Size: 798 Bytes
Versions: 18
Compression:
Stored size: 798 Bytes
Contents
# frozen_string_literal: true # # The Base Account # 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
18 entries across 18 versions & 1 rubygems