Module: XID

Defined in:
lib/xid/connection_adapters/mysql2_adapter.rb,
lib/xid.rb,
lib/xid/railtie.rb,
lib/xid/version.rb,
lib/xid/connection_adapters/mysql_adapter.rb,
lib/xid/connection_adapters/abstract_adapter.rb,
lib/xid/connection_adapters/synthetic_adapter.rb,
lib/xid/connection_adapters/postgresql_adapter.rb,
lib/xid/connection_adapters/oracle_enhanced_adapter.rb

Overview

TODO this is just duplicate of Mysql, so you know, could be DRYer.

Defined Under Namespace

Modules: ConnectionAdapters Classes: Railtie

Constant Summary collapse

VERSION =
"0.0.3"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.adapterObject

Returns the value of attribute adapter.



5
6
7
# File 'lib/xid.rb', line 5

def adapter
  @adapter
end

.synthetic_idObject

Returns the value of attribute synthetic_id.



5
6
7
# File 'lib/xid.rb', line 5

def synthetic_id
  @synthetic_id
end

Class Method Details

.loadObject



10
11
12
13
14
15
# File 'lib/xid.rb', line 10

def self.load
  @adapter ||= ActiveRecord::Base.connection_pool.spec.config[:adapter]
  require "xid/connection_adapters/#{@adapter}_adapter"
rescue LoadError
  puts "XID was unable to load the transaction ID extension for the '#{@adapter}' adapter"
end

.use_synthetic_id!Object



17
18
19
20
21
22
# File 'lib/xid.rb', line 17

def self.use_synthetic_id!
  @synthetic_id = true
  @adapter = :synthetic 
  require "xid/connection_adapters/synthetic_adapter"
  ActiveRecord::Base.connection.class.send :include, XID::ConnectionAdapters::SyntheticAdapter 
end