-
-
Notifications
You must be signed in to change notification settings - Fork 490
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* teach #move_to_child_with_index to accept :root as a target. * refactor out duplication within #move_to_child_with_index. * teach #move_to_child_of to also accept :root and use it internally within #move_to_child_with_index. * extract #roots which is a instance-level version of .roots, and use within #move_to_child_with_index. * update CHANGELOG. --------- Co-authored-by: Micah Geisel <[email protected]>
- Loading branch information
1 parent
70cdc5e
commit e2f88c1
Showing
4 changed files
with
39 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,10 @@ def root | |
end | ||
end | ||
|
||
def roots | ||
nested_set_scope.where(parent_id: nil) | ||
end | ||
|
||
protected | ||
|
||
def compute_level | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters