If I have a self-referential Topic class and I want to recursively loop through all of my subtopics, what would be a good Ruby way to do that:
@category.topics.all(:parent_id => topic.id).each do |subtopic|
subtopic.delete_tags
@category.topics.all(:parent_id => subtopic.id).each do |subsubtopic|
subsubtopic.delete_tags
@category.topics.all(:parent_id => subsubtopic.id).each do |subsubsubtopic|
subsubtopic.delete_tags
@category.topics.all(:parent_id => subsubsubtopic.id).each do |subsubsubsubtopic|
subsubsubtopic.delete_tags
end
end
end
end