Skip to content

Instantly share code, notes, and snippets.

@jerodsanto
Created August 2, 2010 16:08
Show Gist options
  • Save jerodsanto/504858 to your computer and use it in GitHub Desktop.
Save jerodsanto/504858 to your computer and use it in GitHub Desktop.
def self.find_with_destroyed *args
self.with_exclusive_scope { find(*args) }
end
def destroy
return false if callback(:before_destroy) == false
self.deleted_at = current_time_from_proper_timezone
result = update_without_callbacks
callback(:after_destroy)
result
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment