Sha256: a9d99f50ad30f3fd7fa7513d3732745ca2e12ba9d5f00653b4d04013872f7c4d

Contents?: true

Size: 706 Bytes

Versions: 2

Compression:

Stored size: 706 Bytes

Contents

module RocketCMS
  module Models
    module Mongoid
      module Page
        extend ActiveSupport::Concern
        included do
          field :regexp, type: String
          field :redirect, type: String
          field :excerpt, type: String, localize: RocketCMS.configuration.localize
          field :content, type: String, localize: RocketCMS.configuration.localize
          field :fullpath, type: String
          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

2 entries across 2 versions & 1 rubygems

Version Path
ack_rocket_cms-0.7.6.3 lib/rocket_cms/models/mongoid/page.rb
ack_rocket_cms-0.7.6.2 lib/rocket_cms/models/mongoid/page.rb