Project

General

Profile

RE: Ticket grouping plugin ยป awesome_nested_set_patch.diff

awesome_nested_set patch - Andrew Chaika, 2009-05-05 06:06

View differences:

awesome_nested_set.rb (working copy)
# Move the node to the left of another node (you can pass id only)
def move_to_left_of(node)
move_to node, :left
move_to_sub node, :left
end
# Move the node to the left of another node (you can pass id only)
def move_to_right_of(node)
move_to node, :right
move_to_sub node, :right
end
# Move the node to the child of another node (you can pass id only)
def move_to_child_of(node)
move_to node, :child
move_to_sub node, :child
end
# Move the node to root nodes
def move_to_root
move_to nil, :root
move_to_sub nil, :root
end
def move_possible?(target)
......
"#{quoted_right_column_name}, #{quoted_parent_column_name}")
end
def move_to(target, position)
def move_to_sub(target, position)
raise ActiveRecord::ActiveRecordError, "You cannot move a new node" if self.new_record?
return if callback(:before_move) == false
transaction do
    (1-1/1)