Class: Workarea::Content::Email

Inherits:
Object
  • Object
show all
Includes:
ApplicationDocument
Defined in:
app/models/workarea/content/email.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ApplicationDocument

#releasable?

Methods included from Sidekiq::Callbacks

add_worker, assert_valid_config!, async, caching_classes?, disable, enable, inline, #run_callbacks, workers, workers_list

Methods included from Mongoid::Document

#embedded_children

Class Method Details

.find_by_type(type) ⇒ Object



17
18
19
# File 'app/models/workarea/content/email.rb', line 17

def self.find_by_type(type)
  find_by(type: type) rescue nil
end

.find_content(type) ⇒ Object



13
14
15
# File 'app/models/workarea/content/email.rb', line 13

def self.find_content(type)
  find_by_type(type).try(:content).to_s
end

Instance Method Details

#nameObject

The given :type of this email, titleized. Used in the activity feed to display when this email’s content was edited.

Examples:

type=“account_creation”

Account Creation


26
27
28
# File 'app/models/workarea/content/email.rb', line 26

def name
  type.titleize
end