Sha256: 02dcbc7b47697b6a9d9fa55f54341c90d028b0ee0715cde7b662d5fcdbd7898e

Contents?: true

Size: 870 Bytes

Versions: 11

Compression:

Stored size: 870 Bytes

Contents

module Effective
  class Page < ActiveRecord::Base
    acts_as_sluggable
    acts_as_role_restricted
    acts_as_regionable

    has_many :menu_items, :as => :menuable, :dependent => :destroy

    self.table_name = EffectivePages.pages_table_name.to_s

    structure do
      title             :string, :validates => [:presence, :length => {:maximum => 255}]
      meta_description  :string, :validates => [:presence, :length => {:maximum => 150}]

      draft             :boolean, :default => false

      layout            :string, :default => 'application', :validates => [:presence]
      template          :string, :validates => [:presence]

      slug              :string
      roles_mask        :integer, :default => 0

      timestamps
    end

    scope :drafts, -> { where(:draft => true) }
    scope :published, -> { where(:draft => false) }
  end

end




Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
effective_pages-1.0.11 app/models/effective/page.rb
effective_pages-1.0.10 app/models/effective/page.rb
effective_pages-1.0.9 app/models/effective/page.rb
effective_pages-1.0.8 app/models/effective/page.rb
effective_pages-1.0.7 app/models/effective/page.rb
effective_pages-1.0.6 app/models/effective/page.rb
effective_pages-1.0.5 app/models/effective/page.rb
effective_pages-1.0.4 app/models/effective/page.rb
effective_pages-1.0.3 app/models/effective/page.rb
effective_pages-1.0.2 app/models/effective/page.rb
effective_pages-1.0.1 app/models/effective/page.rb