Sha256: 8db078107e821fe720cd8286819cc694359acbf30600a0605b132e1dfea7f57f
Contents?: true
Size: 466 Bytes
Versions: 11
Compression:
Stored size: 466 Bytes
Contents
module Brightcontent class Page < ActiveRecord::Base acts_as_nested_set attr_accessible :body, :name, :parent_id validates_presence_of :name after_save :update_slug default_scope order('lft') def homepage? lft == 1 end private def update_slug self.update_column(:slug, slug_name) end def slug_name homepage? ? "" : self_and_ancestors.map { |p| p.name.parameterize }.join("/") end end end
Version data entries
11 entries across 11 versions & 2 rubygems