Sha256: e54e373c66bde6b452602d30b4336ee51f0e9f3067e37afe678005edb6675987

Contents?: true

Size: 979 Bytes

Versions: 92

Compression:

Stored size: 979 Bytes

Contents

##
## 2023-03-04 _vp_ When I receive one.
## 2023-03-04 _vp_ When I send one, forever.
##
class WcoEmail::EmailActionTemplate
  include Mongoid::Document
  include Mongoid::Timestamps
  include Mongoid::Paranoia
  store_in collection: 'wco_email_email_actions'

  field :slug, type: :string
  validates :slug, uniqueness: true, allow_nil: true
  index({ slug: 1 }, { unique: true, name: "slug_idx" })

  # field :from_email ## this is in email_template

  belongs_to :email_template, class_name: 'EmailTemplate'

  has_many :email_actions, class_name: 'EmailAction'

  has_many :ties,      class_name: '::WcoEmail::EmailActionTemplateTie', inverse_of: :tmpl
  has_many :prev_ties, class_name: '::WcoEmail::EmailActionTemplateTie', inverse_of: :next_tmpl
  accepts_nested_attributes_for :ties

  has_many :email_filters, class_name: 'EmailFilter', inverse_of: :email_action

  def to_s
    slug
  end

  def self.list
    [[nil,nil]] + all.map { |a| [ a.slug, a.id ] }
  end
end

Version data entries

92 entries across 92 versions & 1 rubygems

Version Path
wco_models-3.1.0.155 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.154 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.153 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.152 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.151 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.150 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.149 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.148 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.147 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.146 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.145 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.144 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.143 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.142 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.141 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.140 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.139 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.138 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.137 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.136 app/models/wco_email/email_action_template.rb