You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 21, 2025. It is now read-only.
Makes the discard gem's callbacks available in Rails observers.
Installation
Add this line to your application's Gemfile:
gem'discard-rails-observers'
And then execute:
$ bundle
Or install it yourself as:
$ gem install discard-rails-observers
Usage
Use the discard callbacks in your Rails observers like you normally would:
classMyObserver < ActiveRecord::Observerdefbefore_discard(my_obj)# do somethingend# Other callbacks available:# around_discard# after_discard# before_undiscard# around_undiscard# after_undiscardend
Development
After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.