No commit activity in last 3 years
No release in over 3 years
Easy way to check model state in after_commit callback
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

after_commit_state

Use this module to check model state in after_commit callback, if it was created or updated.

Usage

Add the following to your Gemfile:

gem 'after_commit_state'

Now you can use it in ActiveRecord model after_commit callback

after_commit :after_commit_hook
def after_commit_hook
  puts 'Created' if created?
  puts 'Updated' if updated?
end