Sha256: 4dfc3e9850a37eff62c8cb5587abdebcf501193cd716e4655351cd60b920a3f3

Contents?: true

Size: 771 Bytes

Versions: 3

Compression:

Stored size: 771 Bytes

Contents

module RocketCMS
  module Models
    module Mongoid
      module Page
        extend ActiveSupport::Concern
        included do
          field :regexp, type: String, default: ""
          field :redirect, type: String, default: ""
          field :excerpt, type: String, localize: RocketCMS.configuration.localize, default: ""
          field :content, type: String, localize: RocketCMS.configuration.localize, default: ""
          field :fullpath, type: String, default: ""
          has_and_belongs_to_many :menus, inverse_of: :pages
          acts_as_nested_set

          manual_slug :name

          scope :sorted, -> { order_by([:lft, :asc]) }
          scope :menu, ->(menu_id) { enabled.sorted.where(menu_ids: menu_id) }
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ack_rocket_cms-0.7.7.1 lib/rocket_cms/models/mongoid/page.rb
ack_rocket_cms-0.7.7 lib/rocket_cms/models/mongoid/page.rb
ack_rocket_cms-0.7.6.4 lib/rocket_cms/models/mongoid/page.rb