Class: Archangel::Page

Inherits:
ApplicationRecord show all
Extended by:
ActsAsTree::TreeView
Defined in:
app/models/archangel/page.rb

Overview

Page model

Instance Method Summary collapse

Instance Method Details

#available?Boolean

Check if Page is currently available.

This will return true if there is a published date and it is in the past. Future publication date will return false.


77
78
79
# File 'app/models/archangel/page.rb', line 77

def available?
  published? && published_at <= Time.now
end

#published?Boolean

Check if Page is published.

Future publication date is also considered published. This will return true if there is any published date avaialable; past and future.

See Also:


65
66
67
# File 'app/models/archangel/page.rb', line 65

def published?
  published_at.present?
end

#to_liquidObject

Liquid object for Page


86
87
88
# File 'app/models/archangel/page.rb', line 86

def to_liquid
  Archangel::Liquid::Drops::PageDrop.new(self)
end