fix the broken tests

This commit is contained in:
Didier Lafforgue 2012-02-21 01:45:45 +01:00
parent fa2cd996ce
commit c6e1276974

View File

@ -19,9 +19,6 @@ module Locomotive
## indexes ##
index :position
index [:depth.asc, :position.asc]
## scopes ##
default_scope :where => {} # disable the default_scope from the Mongoid::Tree gem
end
module ClassMethods
@ -36,7 +33,7 @@ module Locomotive
# @return [ Array ] The first array of pages (depth = 0)
#
def quick_tree(site, minimal_attributes = true)
pages = (minimal_attributes ? site.pages.minimal_attributes : site.pages).order_by([:depth.asc, :position.asc]).to_a
pages = (minimal_attributes ? site.pages.unscoped.minimal_attributes : site.pages.unscoped).order_by([:depth.asc, :position.asc]).to_a
tmp = []