Skip to content

Instantly share code, notes, and snippets.

@dustin
Forked from damon/gist:41453
Created December 30, 2008 00:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustin/41462 to your computer and use it in GitHub Desktop.
Save dustin/41462 to your computer and use it in GitHub Desktop.
def whack(objects)
Hash[*objects.map{|o| [o.send('table_name'), o.send('delete_all')]}.flatten]
end
# or (depending on what "send" means there)
def whack(objects)
Hash[*objects.map{|o| [o.table_name, o.delete_all]}.flatten]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment