app/models/brightcontent/page.rb in brightcontent-pages-2.0.17 vs app/models/brightcontent/page.rb in brightcontent-pages-2.0.18

- old
+ new

@@ -1,37 +1,5 @@ module Brightcontent class Page < ActiveRecord::Base - attr_accessible :body, :name, :parent_id, :hidden - acts_as_nested_set - include Brightcontent::Attachable - - validates_presence_of :name - after_save :update_slug - - def self.default_scope - order(:lft) - end - - def homepage? - lft == 1 - end - - def attachment_styles - Brightcontent.page_attachment_styles - end - - def root_parent_children - root? ? children : ancestors.first.children - 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 - + include Brightcontent::PageCore end end