Class: TypeStation::Page
- Includes:
- Concerns::PathGenerator, Concerns::Templatable
- Defined in:
- app/models/type_station/page.rb
Constant Summary collapse
- STATUS =
[:hidden, :draft, :published]
Instance Method Summary collapse
-
#redirect? ⇒ Boolean
INSTANT METHODS.
- #visible?(user) ⇒ Boolean
Methods included from Concerns::Templatable
Methods inherited from Entity
#content?, #content_attributes, #entity_fields?, find_by_name, #get, #move_entity, #set, #update_contents
Instance Method Details
#redirect? ⇒ Boolean
INSTANT METHODS
19 20 21 |
# File 'app/models/type_station/page.rb', line 19 def redirect? redirect_to.present? end |
#visible?(user) ⇒ Boolean
23 24 25 26 27 28 29 30 31 |
# File 'app/models/type_station/page.rb', line 23 def visible?(user) return true if parent_id == nil # The root page is always visible if user.present? [:draft, :published].include?(status) else status == :published end end |