use flat_map instead of collect&flatten
script to remove all data from an instance

using popit-ruby