Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

restore_ancestry_integrity! makes tree - plain #88

nilcolor opened this Issue Mar 11, 2012 · 2 comments


None yet
2 participants
root = Path.create! :segment => 'A0'
item1 = Path.create! :segment => '00', :parent => root
item2 = Path.create! :segment => '001', :parent => item1

This is something looks like this:


Look fine. Now: Path.restore_ancestry_integrity!. And this is what i've got:

SELECT "paths".* FROM "paths" WHERE ("paths"."id" >= 0) ORDER BY "paths"."id" ASC LIMIT 1000
UPDATE "paths" SET "ancestry" = NULL, "updated_at" = '2012-03-11 11:23:03.522356' WHERE "paths"."id" = 2
UPDATE "paths" SET "ancestry" = NULL, "updated_at" = '2012-03-11 11:23:03.538119' WHERE "paths"."id" = 3
SELECT "paths".* FROM "paths" WHERE ("paths"."id" >= 0) ORDER BY "paths"."id" ASC LIMIT 1000

And now I have 3 roots vs one tree...

I saw your last commit is exactly about this, but... Maybe gem 'ancestry' doesn't use last [master] version?


vanderhoorn commented Mar 15, 2012

Indeed. Version 1.2.4 did not use the last version in master. I just released a new version (1.2.5), which fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment