Files
manyfold/app/lib/cli/collections_command.rb
2026-02-09 15:45:58 +00:00

14 lines
302 B
Ruby

require "thor"
module Cli
class CollectionsCommand < Thor
namespace :collections
DESCRIPTION = "manage collections"
desc "prune", "removes all empty collections"
def prune
Collection.find_each { |it| it.destroy if it.models.empty? && it.collections.empty? }
end
end
end