Module: ClosureTree::NumericOrderSupport

Defined in:
lib/closure_tree/numeric_order_support.rb

Defined Under Namespace

Modules: GenericAdapter, MysqlAdapter, PostgreSQLAdapter

Class Method Summary collapse

Class Method Details

.adapter_for_connection(connection) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/closure_tree/numeric_order_support.rb', line 4

def self.adapter_for_connection(connection)
  das = WithAdvisoryLock::DatabaseAdapterSupport.new(connection)
  if das.postgresql?
    ::ClosureTree::NumericOrderSupport::PostgreSQLAdapter
  elsif das.mysql?
    ::ClosureTree::NumericOrderSupport::MysqlAdapter
  else
    ::ClosureTree::NumericOrderSupport::GenericAdapter
  end
end