Activerecord::CommittedObserver
TODO: Write a gem description
Installation
Add this line to your application’s Gemfile:
gem 'activerecord-committed_observer'
And then execute:
$ bundle
Or install it yourself as:
$ gem install activerecord-committed_observer
Usage
Make sure you include CommittedObserver in any of the Observers you want to hook after_commit methods on
```ruby class BigObserver < ::ActiveRecord::Observer include ::ActiveRecord::CommittedObserver
def after_commit_on_create(big)
# do some things and stuff
end
def after_commit_on_update(big)
# Check `previous_changes` because it is after_commit!
end
end ```
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request