Ticket #29 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

renumber_full_tree doesn't increment the next root properly

Reported by: rails Assigned to: jcm
Priority: minor Milestone:
Component: plugin Version:
Keywords: Cc:

Description

When running renumber_all or renumber_full_tree, the first root is renumbered properly, but the subsequent roots have an incorrect lft value (the lft value = the rgt value of the previous root, when I believe that it should be rgt + 1).

The fix is quite easy (in the calc_numbers method, line 318 of better_nested_set.rb r39) from:

n = r.calc_numbers(n, indexes)

to:

n = r.calc_numbers(n, indexes) + 1

Change History

04/26/07 21:21:19 changed by rails

Correction: the line to be changed is in the better_nested_set#renumber_full_tree method, which is line 696 in better_nested_set.rb r62

08/14/07 21:54:32 changed by rails

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in trunk in revision 76.

Krishna