Skip to content

brontes3d/commit_callback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CommitCallback

adds commit_callback to ActiveRecord::Base, usually you’ll want to call it from an after_save hook. For Example:

after_save :send_some_message def send_some_message self.commit_callback do #do the real message sending now that we’re sure self has been committed to the DB end end

For test:

if your tests

use_transactional_fixtures = true

then you might find it useful to put this in your setup CommitCallback.adapt_for_transactional_test!(ActiveRecord::Base.connection) Copyright © 2009 3M. All rights reserved. Released under the MIT license.

Authored by Jacob Burkhart.