app/models/locomotive/extensions/page/tree.rb
# Assigns the new position of each child of this node.
#
# @param [ Array ] ids The ordered list of page ids (string)
#
Assigns the new position of each child of this node.
Assigns the new position of each child of this node .
def sort_children!(ids)
          position, cached_children = 0, self.children.to_a
          ids.each do |id|
            if child = cached_children.detect { |p| p._id == Moped::BSON::ObjectId(id) }
              child.position = position
              child.save
              position += 1
            end
          end
        end
def sort_children! ( ids ) position , cached_children = 0 , self . children . to_a ids . each do | id | if child = cached_children . detect { | p | p . _id == Moped :: BSON :: ObjectId ( id ) } child . position = position child . save position += 1 end end end
Assigns the new position of each child of this node.
Assigns the new position of each child of this node .
ids
<not_specific>
<not_specific>
ids The ordered list of page ids (string)
ids The ordered list of page ids ( string )