def move_above(other)
      if position > other.position
        new_position = other.position
        other.lower_siblings.where(:position.lt => self.position).each { |s| s.inc(:position, 1) }
        other.inc(:position, 1)
        self.position = new_position
        save!
      else
        new_position = other.position - 1
        other.higher_siblings.where(:position.gt => self.position).each { |s| s.inc(:position, -1) }
        self.position = new_position
        save!
      end
    end
def move_above(other)
      if position > other.position
        new_position = other.position
        other.lower_siblings.where(:position.lt => self.position).each { |s| s.inc(:position, 1) }
        other.inc(:position, 1)
        self.position = new_position
        save!
      else
        new_position = other.position - 1
        other.higher_siblings.where(:position.gt => self.position).each { |s| s.inc(:position, -1) }
        self.position = new_position
        save!
      end
    end
def move_above ( other ) if position > other . position new_position = other . position other . lower_siblings . where ( :position . lt => self . position ) . each { | s | s . inc ( :position , 1 ) } other . inc ( :position , 1 ) self . position = new_position save! else new_position = other . position - 1 other . higher_siblings . where ( :position . gt => self . position ) . each { | s | s . inc ( :position , - 1 ) } self . position = new_position save! end end
Move this node above the specified node

 This method changes the node's parent if nescessary.
Move this node above the specified node