Class: Page

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Publishable, Renderable, Sluggable
Defined in:
app/models/page.rb

Overview

Pages are published if published_at is not nil. TODO: schedule publish by comparing published_at to Time.now

Pages can have a parent. Top-level pages have no parent. Top-level pages appear in the navbar.

Pages must have a slug, usually based on title.

Pages render body_markdown as body_html on save.

Class Method Summary collapse

Methods included from Publishable

#draft?, #published?

Class Method Details

.top_levelObject


22
23
24
# File 'app/models/page.rb', line 22

def self.top_level
  where(parent: nil)
end