This is simpler, and still runs inside the same transaction (#destroy uses a transaction internally). Also, use Dataset#destroy instead of all.each(&:destroy).
660 B
660 B