Class: Landable::TemplateRevision

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
TableName
Defined in:
app/models/landable/template_revision.rb

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.ignored_template_attributesObject

Returns the value of attribute ignored_template_attributes.



7
8
9
# File 'app/models/landable/template_revision.rb', line 7

def ignored_template_attributes
  @ignored_template_attributes
end

Instance Method Details

#publish!Object



25
26
27
# File 'app/models/landable/template_revision.rb', line 25

def publish!
  update_attribute :is_published, true
end

#template_id=(id) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'app/models/landable/template_revision.rb', line 13

def template_id=(id)
  # set the value
  self[:template_id] = id

  # copy attributes from the template
  self.name          = template.name
  self.body          = template.body
  self.description   = template.description
  self.category_id   = template.category_id
  self.slug          = template.slug
end

#unpublish!Object



29
30
31
# File 'app/models/landable/template_revision.rb', line 29

def unpublish!
  update_attribute :is_published, false
end