Permalink
Browse files

Drop support for postgres driver. Use pg >= 0.9.0.

  • Loading branch information...
jeremy committed Apr 24, 2010
1 parent 577034d commit 70625badcf3c3f1be8d14181040099d6ca5f7a2b
Showing with 4 additions and 16 deletions.
  1. +2 −0 activerecord/CHANGELOG
  2. +2 −16 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
View
@@ -1,5 +1,7 @@
*Rails 3.0.0 [beta 4/release candidate] (unreleased)*
+* PostgreSQL: drop support for old postgres driver. Use pg 0.9.0 or later. [Jeremy Kemper]
+
* Observers can prevent records from saving by returning false, just like before_save and friends. #4087 [Mislav Marohnić]
@@ -2,26 +2,12 @@
require 'active_support/core_ext/kernel/requires'
require 'active_support/core_ext/object/blank'
-begin
- require_library_or_gem 'pg'
-rescue LoadError => e
- begin
- require_library_or_gem 'postgres'
- class PGresult
- alias_method :nfields, :num_fields unless self.method_defined?(:nfields)
- alias_method :ntuples, :num_tuples unless self.method_defined?(:ntuples)
- alias_method :ftype, :type unless self.method_defined?(:ftype)
- alias_method :cmd_tuples, :cmdtuples unless self.method_defined?(:cmd_tuples)
- end
- rescue LoadError
- raise e
- end
-end
-
module ActiveRecord
class Base
# Establishes a connection to the database that's used by all Active Record objects
def self.postgresql_connection(config) # :nodoc:
+ require 'pg'
+
config = config.symbolize_keys
host = config[:host]
port = config[:port] || 5432

0 comments on commit 70625ba

Please sign in to comment.