Sha256: 0adf25f91bea65395e9607011551029e0a225fd72564312b9840279ec607a4fa

Contents?: true

Size: 425 Bytes

Versions: 2

Compression:

Stored size: 425 Bytes

Contents

class Page < ActiveRecord::Base
  include Content
  include Nestable
  
  validates_presence_of :uid, :name

  field :name
  field :uid
  index :uid, :unique => true
  
  field :path
  field :resource_type
  
  def home?
    path == "/"
  end

  def resourceful?
    resource_type.present?
  end
  
  def to_label
    name
  end

  has_many :page_parts
  accepts_nested_attributes_for :page_parts, :allow_destroy => true

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fullstack-cms-0.1.9 app/models/page.rb
fullstack-cms-0.1.8 app/models/page.rb