cfabianski / ltree_hierarchy

Organize ActiveRecord models into a tree using PostgreSQL's ltree datatype
MIT License
140 stars 25 forks source link

Possible error with cascade_path_change? #18

Open idyll opened 8 years ago

idyll commented 8 years ago

We have a situation where children can be input before their parents on a tree structure.

It seems that when the parent is added there are issues updating the children. We noticed this because the children count was higher than the descendants. And then looking at the path we determined that one of the children had a bad path:

(15.11.19 instead of 12.15.11.19).

Any thoughts on this?

We're looking to replicate this and will submit a PR with a fix once we find the cause.

I was hoping someone else might have see it too...

tomekw commented 8 years ago

Thank you @idyll. I will try to look into this as soon as possible. Patch or at least failing spec is more than welcome, though! :)

idyll commented 8 years ago

I will try to get a failing spec to you sometime this week. Last week got away from me.

tomekw commented 8 years ago

Same here, I totally forgot about this!