Module: Simple::SQL::Connection

Defined in:
lib/simple/sql/connection.rb

Overview

private

Defined Under Namespace

Classes: ActiveRecordConnection, RawConnection, SimpleConnection

Class Method Summary collapse

Class Method Details

.new(connection) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/simple/sql/connection.rb', line 6

def self.new(connection)
  if defined?(ActiveRecord)
    if connection.is_a?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
      return ActiveRecordConnection.new(connection)
    end
  end

  SimpleConnection.new(connection)
end