aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Rudy Jacobs <MatthewRudyJacobs@gmail.com>2010-11-21 00:18:33 +0800
committerMatthew Rudy Jacobs <MatthewRudyJacobs@gmail.com>2010-11-21 00:18:33 +0800
commitd9ac62c91466e40b557d27c4d712f86759d63a4b (patch)
tree25ed1c6e6ab1609c7b874f94d40cee8f5c1d6962
parent206e48e8b943981b5b9ffc1fe7a2150e2ac21427 (diff)
downloadrails-d9ac62c91466e40b557d27c4d712f86759d63a4b.tar.gz
rails-d9ac62c91466e40b557d27c4d712f86759d63a4b.tar.bz2
rails-d9ac62c91466e40b557d27c4d712f86759d63a4b.zip
Fix Bug: disable_referential_integrity doesn't work for postgres 9.0.1
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index ccc5085b84..7dd81abc7e 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -404,10 +404,7 @@ module ActiveRecord
# REFERENTIAL INTEGRITY ====================================
def supports_disable_referential_integrity?() #:nodoc:
- version = query("SHOW server_version")[0][0].split('.')
- version[0].to_i >= 8 && version[1].to_i >= 1
- rescue
- return false
+ postgresql_version >= 80100
end
def disable_referential_integrity #:nodoc: