Skip to content

depth_cache doesn't get updated fo children when moving parent up the hierarchy #64

quorak opened this Issue Jul 14, 2011 · 3 comments

4 participants

quorak commented Jul 14, 2011

when i change the parent of a node with the depth of 6 to a parent with dept 4,
the depth_cache of that node gets updated, but not the depth_cache of its children.


I got around this by adding before_save :cache_depth to my Node model.

It seems the depth caching is currently done in a before_validation callback that doesn't get called when update_descendants_with_new_ancestry is called as it uses update_attribute, which skips validation.


I think I ran into the same issue. I'll see if I can write a fix for it.

StefanH commented May 7, 2013

Fixed in 2.0 by #74

@StefanH StefanH closed this May 7, 2013
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.