aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
diff options
context:
space:
mode:
authorYasuo Honda <yasuo.honda@gmail.com>2017-10-24 21:45:05 +0000
committerYasuo Honda <yasuo.honda@gmail.com>2017-10-24 21:46:10 +0000
commit5cd6f1792e9710979ce53943c28b2b38dae34e98 (patch)
tree6124061bdb955df20b6dbe1d766d396d0b678418 /activerecord/lib/active_record/connection_adapters
parent9a55eb055fe02c1b462d9df08ff199688f974f42 (diff)
downloadrails-5cd6f1792e9710979ce53943c28b2b38dae34e98.tar.gz
rails-5cd6f1792e9710979ce53943c28b2b38dae34e98.tar.bz2
rails-5cd6f1792e9710979ce53943c28b2b38dae34e98.zip
`supports_extensions?` return always true since PostgreSQL 9.1
since the minimum version of PostgreSQL currently Rails supports is 9.1, there is no need to handle if `supports_extensions?` Refer https://www.postgresql.org/docs/9.1/static/sql-createextension.html "CREATE EXTENSION"
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb12
1 files changed, 3 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index e9ae861bfb..2c3c1df2a9 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -337,18 +337,12 @@ module ActiveRecord
end
def extension_enabled?(name)
- if supports_extensions?
- res = exec_query("SELECT EXISTS(SELECT * FROM pg_available_extensions WHERE name = '#{name}' AND installed_version IS NOT NULL) as enabled", "SCHEMA")
- res.cast_values.first
- end
+ res = exec_query("SELECT EXISTS(SELECT * FROM pg_available_extensions WHERE name = '#{name}' AND installed_version IS NOT NULL) as enabled", "SCHEMA")
+ res.cast_values.first
end
def extensions
- if supports_extensions?
- exec_query("SELECT extname FROM pg_extension", "SCHEMA").cast_values
- else
- super
- end
+ exec_query("SELECT extname FROM pg_extension", "SCHEMA").cast_values
end
# Returns the configured supported identifier length supported by PostgreSQL