public
Fork of ninjudd/after_commit
Description: A Ruby on Rails plugin to add an after_commit callback. This can be used to trigger things only after the entire transaction is complete.
Homepage:
Clone URL: git://github.com/trotter/after_commit.git
after_commit / init.rb
100644 9 lines (7 sloc) 0.28 kb
1
2
3
4
5
6
7
8
9
ActiveRecord::Base.class_eval do
  include AfterCommit::ActiveRecord
  include AfterCommit::TestBypass if RAILS_ENV == 'test'
end
 
Object.subclasses_of(ActiveRecord::ConnectionAdapters::AbstractAdapter).each do |klass|
  klass.send(:include, AfterCommit::ConnectionAdapters)
end