/usr/lib/ruby/vendor_ruby/test_after_commit.rb is in ruby-test-after-commit 1.0.0-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | require 'test_after_commit/version'
if ActiveRecord::VERSION::MAJOR >= 5
raise 'after_commit testing is baked into rails 5, you no longer need test_after_commit gem'
end
if ActiveRecord::VERSION::MAJOR >= 4
require 'test_after_commit/with_transaction_state'
ActiveRecord::Base.send(:prepend, TestAfterCommit::WithTransactionState)
end
require 'test_after_commit/database_statements'
ActiveRecord::ConnectionAdapters::AbstractAdapter.send(:prepend, TestAfterCommit::DatabaseStatements)
module TestAfterCommit
@enabled = true
class << self
attr_accessor :enabled
def with_commits(value = true)
old = enabled
self.enabled = value
yield
ensure
self.enabled = old
end
end
end
|