Class: Page
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Page
- Defined in:
- app/models/page.rb
Instance Attribute Summary collapse
-
#page_urls ⇒ Object
Returns the value of attribute page_urls.
Instance Method Summary collapse
Instance Attribute Details
#page_urls ⇒ Object
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
#activate ⇒ Object
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 |
#clone ⇒ Object
64 65 66 67 68 69 70 71 |
# File 'app/models/page.rb', line 64 def clone page = super page. = .clone if page.translations = translations.clone unless translations.empty? page.page_cols = page_cols.map(&:clone) page. = return page end |
#min_cols_by_page ⇒ Object
52 53 54 |
# File 'app/models/page.rb', line 52 def min_cols_by_page 1 end |
#name ⇒ Object
44 45 46 |
# File 'app/models/page.rb', line 44 def name self.title end |