Module: TransactionIsolation

Defined in:
lib/transaction_isolation.rb,
lib/transaction_isolation/version.rb,
lib/transaction_isolation/configuration.rb,
lib/transaction_isolation/active_record/base.rb,
lib/transaction_isolation/active_record/connection_adapters/mysql2_adapter.rb,
lib/transaction_isolation/active_record/connection_adapters/sqlite3_adapter.rb,
lib/transaction_isolation/active_record/connection_adapters/abstract_adapter.rb,
lib/transaction_isolation/active_record/connection_adapters/postgresql_adapter.rb

Defined Under Namespace

Modules: ActiveRecord Classes: Configuration, Railtie

Constant Summary collapse

VERSION =
'1.1.1'

Class Method Summary collapse

Class Method Details

.apply_activerecord_patchObject

Must be called after ActiveRecord established a connection. Only then we know which connection adapter is actually loaded and can be enhanced. Please note ActiveRecord does not load unused adapters.



11
12
13
14
15
16
17
18
# File 'lib/transaction_isolation.rb', line 11

def self.apply_activerecord_patch
  require_relative 'transaction_isolation/active_record/errors'
  require_relative 'transaction_isolation/active_record/base'
  require_relative 'transaction_isolation/active_record/connection_adapters/abstract_adapter'
  require_relative 'transaction_isolation/active_record/connection_adapters/mysql2_adapter'
  require_relative 'transaction_isolation/active_record/connection_adapters/postgresql_adapter'
  require_relative 'transaction_isolation/active_record/connection_adapters/sqlite3_adapter'
end

.config {|config| ... } ⇒ Object

Yields:



29
30
31
32
33
# File 'lib/transaction_isolation.rb', line 29

def self.config
  config = configuration
  yield(config) if block_given?
  config
end

.configurationObject



20
21
22
# File 'lib/transaction_isolation.rb', line 20

def self.configuration
  @configuration ||= Configuration.new
end

.configure {|config| ... } ⇒ Object

Yields:



24
25
26
27
# File 'lib/transaction_isolation.rb', line 24

def self.configure
  config = configuration
  yield(config)
end