Class: Page

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#page_urlsObject

Returns the value of attribute page_urls.



6
7
8
# File 'app/models/page.rb', line 6

def page_urls
  @page_urls
end

Instance Method Details

#activateObject



56
57
58
59
60
61
62
# File 'app/models/page.rb', line 56

def activate
  # set publication date if page changes from inactive to active
  self.published_at = Time.now unless self.active

  # update active status
  self.update_attribute('active', !self.active)
end

#cloneObject



64
65
66
67
68
69
70
71
# File 'app/models/page.rb', line 64

def clone
  page = super
  page.meta_info = meta_info.clone if meta_info
  page.translations = translations.clone unless translations.empty?
  page.page_cols = page_cols.map(&:clone)
  page.tags = tags
  return page
end

#min_cols_by_pageObject



52
53
54
# File 'app/models/page.rb', line 52

def min_cols_by_page
  1
end

#nameObject



44
45
46
# File 'app/models/page.rb', line 44

def name
  self.title
end