Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

restore_ancestry_integrity! makes tree - plain #88

Closed
nilcolor opened this Issue · 2 comments

2 participants

@nilcolor
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:

root
  '-item1
      '-item2

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...

@nilcolor

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

@vanderhoorn
Collaborator

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
Something went wrong with that request. Please try again.