RailsCasts Pro episodes are now free!

Learn more or hide this

lothar59's Profile

GitHub User: lothar59

Comments by

Avatar

Yes i'm facing problems with acts_as_tree while referencing another parent.

A has a child B then B becomes the child of C. It doesn't refresh the counter_cache for A and C, and i can't set it manually.

I had to force the update with :

Table.connection.update("UPDATE table SET children_count = #{old_parent['children_count'] -= 1} WHERE id = #{old_parent.id}")

If anyone knows any other solution i'm interested.