Created
July 9, 2013 16:51
-
-
Save chrishunt/5959064 to your computer and use it in GitHub Desktop.
Test after_commit hooks in Rails 4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_record/connection_adapters/abstract/transaction' | |
module ActiveRecord | |
module ConnectionAdapters | |
class SavepointTransaction < OpenTransaction | |
def perform_commit_with_transactional_fixtures | |
commit_records if number == 1 | |
perform_commit_without_transactional_fixtures | |
end | |
alias_method_chain :perform_commit, :transactional_fixtures | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment