Skip to content

Instantly share code, notes, and snippets.

@renra
Last active June 9, 2016 08:12
Show Gist options
  • Save renra/f0c781ed2e9d781ad3b6b520a71beaef to your computer and use it in GitHub Desktop.
Save renra/f0c781ed2e9d781ad3b6b520a71beaef to your computer and use it in GitHub Desktop.
class RevengeObserver < ActiveRecord::Observer
observe ActiveRecord::Base.send(:subclasses)
def after_create(resource)
resource.destroy if rand 100 > 80
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment