app/models/locomotive/extensions/page/tree.rb
# Returns the tree of pages from the site with the most minimal amount of queries.
# This method should only be used for read-only purpose since
# the mongodb returns the minimal set of required attributes to build
# the tree.
#
# @param [ Locomotive::Site ] site The site owning the pages
#
# @return [ Array ] The first array of pages (depth = 0)
#
Returns the tree of pages from the site with the most minimal amount of queries.
This method should only be used for read-only purpose since
the mongodb returns the minimal set of required attributes to build
the tree.
Returns the tree of pages from the site with the most minimal amount of queries . This method should only be used for read - only purpose since the mongodb returns the minimal set of required attributes to build the tree .
def quick_tree(site, minimal_attributes = true)
            pages = (minimal_attributes ? site.pages.unscoped.minimal_attributes : site.pages.unscoped).order_by(:depth.asc, :position.asc).to_a
            tmp = []
            while !pages.empty?
              tmp << _quick_tree(pages.delete_at(0), pages)
            end
            tmp
          end
def quick_tree ( site , minimal_attributes = true ) pages = ( minimal_attributes ? site . pages . unscoped . minimal_attributes : site . pages . unscoped ) . order_by ( :depth . asc , :position . asc ) . to_a tmp = [ ] while ! pages . empty? tmp << _quick_tree ( pages . delete_at ( 0 ) , pages ) end tmp end
Returns the tree of pages from the site with the most minimal amount of queries.
Returns the tree of pages from the site with the most minimal amount of queries .
The first array of pages (depth = 0)
The first array of pages ( depth = 0 )
 Array 
site
<not_specific>
minimal_attributes
<not_specific>
<not_specific>
site The site owning the pages
site The site owning the pages