-
-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set depth at rebuild! #449
Comments
Thanks @diesl - can you please debug this a little on your local? The relevant method is here awesome_nested_set/lib/awesome_nested_set/model/relatable.rb Lines 98 to 102 in 36ec2b0
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Not stale, I still need to debug |
This is still valid. We ended up doing |
@parndt Finally I had some time for debugging. I added a awesome_nested_set/lib/awesome_nested_set/tree.rb Lines 18 to 28 in 36ec2b0
I would expect that Seems like you already discovered this behavior many years ago:
Originally posted by @parndt in #116 (comment) |
@diesl thanks - I would expect if |
I just noticed this as well. I've also noticed that calling |
I added Awesome Nested Set to an existing project where we have (scoped) records that are linked with
parent_id
s. After setting things up, I triggered a rebuild on the model. So far, so good,lft
andrgt
were set correctly.However
depth
was set to0
for every record. I also could not find a way to trigger a rebuild for depth (only). Do I miss something here?My brute force workaround was to loop over all records and set
depth
tolevel
which was resolved to the correct value.See also similar tickets #314 and #116 that were closed as stale.
The text was updated successfully, but these errors were encountered: