Sha256: 49669dac2ba2520e45695be762df5de7448a0b28e9d04b52108fc075c285553f

Contents?: true

Size: 822 Bytes

Versions: 14

Compression:

Stored size: 822 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) }

          scope :in_sitemap,    -> { where(sitemap_show: true) }
          scope :sitemap_show,  -> { in_sitemap }
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ack_rocket_cms-0.7.6.1 lib/rocket_cms/models/mongoid/page.rb
ack_rocket_cms-0.7.6 lib/rocket_cms/models/mongoid/page.rb
ack_rocket_cms-0.7.5.2 lib/rocket_cms/models/mongoid/page.rb
ack_rocket_cms-0.7.5.1 lib/rocket_cms/models/mongoid/page.rb
ack_rocket_cms-0.7.5 lib/rocket_cms/models/mongoid/page.rb
ack_rocket_cms-0.7.4.1 lib/rocket_cms/models/mongoid/page.rb
ack_rocket_cms-0.7.4 lib/rocket_cms/models/mongoid/page.rb
ack_rocket_cms-0.7.3 lib/rocket_cms/models/mongoid/page.rb
ack_rocket_cms-0.7.2.4 lib/rocket_cms/models/mongoid/page.rb
ack_rocket_cms-0.7.2.3.2 lib/rocket_cms/models/mongoid/page.rb
ack_rocket_cms-0.7.2.3.1 lib/rocket_cms/models/mongoid/page.rb
ack_rocket_cms-0.7.2.3 lib/rocket_cms/models/mongoid/page.rb
ack_rocket_cms-0.7.2.2 lib/rocket_cms/models/mongoid/page.rb
ack_rocket_cms-0.7.2.1 lib/rocket_cms/models/mongoid/page.rb