Sha256: 2bbf8b8af33b3f8e83a0acffd6f60d85b1acde55bcfdf1c002d9fb7fe6470767

Contents?: true

Size: 458 Bytes

Versions: 1

Compression:

Stored size: 458 Bytes

Contents

module Hancock::Gallery
  module Models
    module Mongoid
      module Gallery
        extend ActiveSupport::Concern

        included do
          index({gallerable_id: 1, gallerable_type: 1}, {background: true})
          index({enabled: 1, lft: 1}, {background: true})

          field :name, type: String, localize: Hancock::Gallery.configuration.localize

          scope :sorted, -> { order_by([:lft, :asc]) }
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hancock_cms_gallery-1.0.2 lib/hancock/gallery/models/mongoid/gallery.rb