39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/advanced_connection/active_record_ext/connection_pool/without_connection.rb', line 39
def without_connection(&block)
return unless block_given?
return block.call unless AdvancedConnection.enable_without_connection
if transaction_open?
Rails.logger.warn "WithoutConnection skipped due to open transaction."
return block.call
end
if AdvancedConnection.callbacks.without_connection.present?
run_callbacks(:without_connection) do
__without_connection { block.call }
end
else
__without_connection { block.call }
end
end
|