@@ -1170,7 +1170,7 class Issue < ActiveRecord::Base | |||
|
1170 | 1170 | # issue was just created |
|
1171 | 1171 | self.root_id = (@parent_issue.nil? ? id : @parent_issue.root_id) |
|
1172 | 1172 | set_default_left_and_right |
|
1173 |
Issue.update_all("root_id = |
|
|
1173 | Issue.update_all(["root_id = ?, lft = ?, rgt = ?", root_id, lft, rgt], ["id = ?", id]) | |
|
1174 | 1174 | if @parent_issue |
|
1175 | 1175 | move_to_child_of(@parent_issue) |
|
1176 | 1176 | end |
@@ -1189,7 +1189,7 class Issue < ActiveRecord::Base | |||
|
1189 | 1189 | self.root_id = (@parent_issue.nil? ? id : @parent_issue.root_id ) |
|
1190 | 1190 | target_maxright = nested_set_scope.maximum(right_column_name) || 0 |
|
1191 | 1191 | offset = target_maxright + 1 - lft |
|
1192 |
Issue.update_all("root_id = |
|
|
1192 | Issue.update_all(["root_id = ?, lft = lft + ?, rgt = rgt + ?", root_id, offset, offset], | |
|
1193 | 1193 | ["root_id = ? AND lft >= ? AND rgt <= ? ", old_root_id, lft, rgt]) |
|
1194 | 1194 | self[left_column_name] = lft + offset |
|
1195 | 1195 | self[right_column_name] = rgt + offset |
General Comments 0
You need to be logged in to leave comments.
Login now