1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-21 07:51:12 +00:00

shorten long line of lib/redmine/database.rb

git-svn-id: http://svn.redmine.org/redmine/trunk@20569 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2020-12-04 13:59:14 +00:00
parent 279ae9cd1e
commit c8462efd86

View File

@ -40,9 +40,14 @@ module Redmine
def postgresql_unaccent? def postgresql_unaccent?
if postgresql? if postgresql?
return @postgresql_unaccent unless @postgresql_unaccent.nil? return @postgresql_unaccent unless @postgresql_unaccent.nil?
begin begin
sql = "SELECT name FROM pg_available_extensions WHERE installed_version IS NOT NULL and name = 'unaccent'" sql =
@postgresql_unaccent = postgresql_version >= 90000 && ActiveRecord::Base.connection.select_value(sql).present? "SELECT name FROM pg_available_extensions " \
"WHERE installed_version IS NOT NULL and name = 'unaccent'"
@postgresql_unaccent =
postgresql_version >= 90000 &&
ActiveRecord::Base.connection.select_value(sql).present?
rescue rescue
false false
end end