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)
          cached_children = self.children.to_a
          ids.each_with_index do |id, position|
            child = cached_children.detect { |p| p._id == Moped::BSON::ObjectId(id) }
            child.position = position
            child.save
          end
        end
def sort_children! ( ids ) cached_children = self . children . to_a ids . each_with_index do | id , position | child = cached_children . detect { | p | p . _id == Moped :: BSON :: ObjectId ( id ) } child . position = position child . save 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 )