Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 390 Bytes

README.md

File metadata and controls

19 lines (15 loc) · 390 Bytes

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