module ActsAsMailable::EmailTemplate

including this module into your EmailTemplate model will give you finders and named scopes useful for working with EmailTemplates. The named scopes are:

in_order: Returns email_templates in the order they were created (created_at ASC).
recent: Returns email_templates by how recently they were created (created_at DESC).
limit(N): Return no more than N email_templates.

Public Class Methods

included(email_template_model) click to toggle source
# File lib/email_template_methods.rb, line 10
def self.included(email_template_model)
  email_template_model.extend Finders
  email_template_model.scope :in_order, -> { email_template_model.order('created_at ASC') }
  email_template_model.scope :recent, -> { email_template_model.reorder('created_at DESC') }
end