lib/hancock/gallery/models/mongoid/gallery.rb in hancock_cms_gallery-1.0.0 vs lib/hancock/gallery/models/mongoid/gallery.rb in hancock_cms_gallery-1.0.2
- old
+ new
@@ -3,9 +3,12 @@
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