Skip to content

Instantly share code, notes, and snippets.

@Chryus
Created February 13, 2015 17:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chryus/d2ff4b2ba52ad8809fd0 to your computer and use it in GitHub Desktop.
Save Chryus/d2ff4b2ba52ad8809fd0 to your computer and use it in GitHub Desktop.
run_callbacks example
def destroy(mode=:soft)
run_callbacks :destroy do
if mode == :hard
super()
else
update(deleted_at: Time.zone.now)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment