RE: Ticket grouping plugin ยป awesome_nested_set_patch.diff
| awesome_nested_set.rb (working copy) | ||
|---|---|---|
| 383 | 383 | |
| 384 | 384 | # Move the node to the left of another node (you can pass id only) | 
| 385 | 385 | def move_to_left_of(node) | 
| 386 | move_to node, :left | |
| 386 |           move_to_sub node, :left | |
| 387 | 387 | end | 
| 388 | 388 | |
| 389 | 389 | # Move the node to the left of another node (you can pass id only) | 
| 390 | 390 | def move_to_right_of(node) | 
| 391 | move_to node, :right | |
| 391 |           move_to_sub node, :right | |
| 392 | 392 | end | 
| 393 | 393 | |
| 394 | 394 | # Move the node to the child of another node (you can pass id only) | 
| 395 | 395 | def move_to_child_of(node) | 
| 396 | move_to node, :child | |
| 396 |           move_to_sub node, :child | |
| 397 | 397 | end | 
| 398 | 398 |  | 
| 399 | 399 | # Move the node to root nodes | 
| 400 | 400 | def move_to_root | 
| 401 | move_to nil, :root | |
| 401 |           move_to_sub nil, :root | |
| 402 | 402 | end | 
| 403 | 403 |  | 
| 404 | 404 | def move_possible?(target) | 
| ... | ... | |
| 472 | 472 |             "#{quoted_right_column_name}, #{quoted_parent_column_name}") | 
| 473 | 473 | end | 
| 474 | 474 |  | 
| 475 | def move_to(target, position) | |
| 475 |         def move_to_sub(target, position) | |
| 476 | 476 | raise ActiveRecord::ActiveRecordError, "You cannot move a new node" if self.new_record? | 
| 477 | 477 | return if callback(:before_move) == false | 
| 478 | 478 | transaction do |