Sha256: 9f761b6c0601556fc23d80ad73d2e3e4842881fca01938b36c9c7deef855278d

Contents?: true

Size: 752 Bytes

Versions: 16

Compression:

Stored size: 752 Bytes

Contents

# Don't need to load native postgres adapter
$LOADED_FEATURES << "active_record/connection_adapters/postgresql_adapter.rb"

class ActiveRecord::Base
  class << self
    def postgresql_connection(config)
      require "arjdbc/postgresql"
      config[:host] ||= "localhost"
      config[:port] ||= 5432
      config[:url] ||= "jdbc:postgresql://#{config[:host]}:#{config[:port]}/#{config[:database]}"
      config[:url] << config[:pg_params] if config[:pg_params]
      config[:driver] ||= "org.postgresql.Driver"
      conn = jdbc_connection(config)
      conn.execute("SET SEARCH_PATH TO #{config[:schema_search_path]}") if config[:schema_search_path]
      conn
    end
    alias_method :jdbcpostgresql_connection, :postgresql_connection
  end
end


Version data entries

16 entries across 16 versions & 5 rubygems

Version Path
intentmedia-activerecord-jdbc-adapter-1.1.1.1 lib/arjdbc/postgresql/connection_methods.rb
c3-activerecord-jdbc-adapter-1.1.3.1 lib/arjdbc/postgresql/connection_methods.rb
c3-activerecord-jdbc-adapter-1.1.3 lib/arjdbc/postgresql/connection_methods.rb
jashmenn-activerecord-jdbc-adapter-1.2.0.0 lib/arjdbc/postgresql/connection_methods.rb
jashmenn-activerecord-jdbc-adapter-1.2.0 lib/arjdbc/postgresql/connection_methods.rb
activerecord-jdbc-adapter-1.1.3 lib/arjdbc/postgresql/connection_methods.rb
activerecord-jdbc-adapter-1.1.2 lib/arjdbc/postgresql/connection_methods.rb
activerecord-jdbc-adapter-1.1.1 lib/arjdbc/postgresql/connection_methods.rb
activerecord-jdbc-adapter-1.1.0 lib/arjdbc/postgresql/connection_methods.rb
activerecord-jdbc-adapter-1.0.3-java lib/arjdbc/postgresql/connection_methods.rb
activerecord-jdbc-adapter-1.0.2-java lib/arjdbc/postgresql/connection_methods.rb
activerecord-jdbc-adapter-1.0.1-java lib/arjdbc/postgresql/connection_methods.rb
activerecord-jdbc-adapter-1.0.0-java lib/arjdbc/postgresql/connection_methods.rb
activerecord-jdbc-adapter-1.0.0.beta2-java lib/arjdbc/postgresql/connection_methods.rb
kb-activerecord-jdbc-adapter-1.0.0.beta1-java lib/arjdbc/postgresql/connection_methods.rb
activerecord-jdbc-adapter-1.0.0.beta1-java lib/arjdbc/postgresql/connection_methods.rb