Class: Archangel::Page
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Archangel::Page
- Extended by:
- ActsAsTree::TreeView
- Defined in:
- app/models/archangel/page.rb
Overview
Page model
Instance Method Summary collapse
-
#published? ⇒ Boolean
Check if Page is published.
-
#status ⇒ String
Return string of publication status.
-
#to_liquid ⇒ Object
Liquid object for Page.
Instance Method Details
#published? ⇒ Boolean
Check if Page is published. Published in the past, present and future. Future publication date is also considered published.
57 58 59 |
# File 'app/models/archangel/page.rb', line 57 def published? published_at.present? end |
#status ⇒ String
Return string of publication status.
66 67 68 69 70 71 72 73 74 75 76 |
# File 'app/models/archangel/page.rb', line 66 def status if published? if published_at > Time.now "future-published" else "published" end else "unpublished" end end |
#to_liquid ⇒ Object
Liquid object for Page
83 84 85 |
# File 'app/models/archangel/page.rb', line 83 def to_liquid Archangel::Liquid::Drops::PageDrop.new(self) end |