Adds build_ancestors funcionality to categories