Sha256: 7af13f7fc811029c14a2bfbbbc07de60de1fa933d1cafb1cc671c6e14e50102b

Contents?: true

Size: 1.12 KB

Versions: 18

Compression:

Stored size: 1.12 KB

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" })

  belongs_to :email_template, class_name: 'WcoEmail::EmailTemplate'
  def tmpl; email_template; end

  has_many :scheduled_email_actions, class_name: 'WcoEmail::ScheduledEmailAction'
  def schs; scheduled_email_actions; end

  has_many :ties,      class_name: 'WcoEmail::EmailActionTie', inverse_of: :email_action
  has_many :prev_ties, class_name: 'WcoEmail::EmailActionTie', inverse_of: :next_email_action
  accepts_nested_attributes_for :ties

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

  ## @TODO: change this right now.
  field :deleted_at, default: nil, type: :time

  def self.list
    [[nil,nil]] + WcoEmail::EmailAction.where({ :deleted_at => nil }).map { |a| [ a.slug, a.id ] }
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
wco_models-3.1.0.55 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.54 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.53 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.52 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.51 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.50 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.49 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.48 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.47 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.46 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.45 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.44 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.43 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.42 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.41 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.40 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.39 app/models/wco_email/email_action_template.rb
wco_models-3.1.0.38 app/models/wco_email/email_action_template.rb