Module: CoreAccount
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/app/models/concerns/core_account.rb
Overview
The Base Account
Class Method Summary collapse
Instance Method Summary collapse
-
#fetch_smtp_configuration ⇒ Object
Return or build the smtp configuration for the account.
Class Method Details
.included(base) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/app/models/concerns/core_account.rb', line 9 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 :smtp_configuration end end |
Instance Method Details
#fetch_smtp_configuration ⇒ Object
Return or build the smtp configuration for the account
39 40 41 |
# File 'lib/app/models/concerns/core_account.rb', line 39 def fetch_smtp_configuration smtp_configuration || build_smtp_configuration end |