Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def destroy_all(conditions = nil)
if conditions
where(conditions).destroy_all
else
to_a.each {|object| object.destroy }.tap { reset }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment