Skip to content

vitalinfo/after_commit_state

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages