Method: HasOrder::InstanceMethods#move_after

Defined in:
lib/has_order.rb

#move_after(node) ⇒ Object



112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/has_order.rb', line 112

def move_after(node)
  self.class.transaction do
    node_pos = node.position
    pos = node_pos + 1

    if list_scope.at(pos).exists?
      node.higher.shift!
    end

    self.position = pos
    save!
  end
end