diff options
-rw-r--r-- | lib/redmine/database.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/redmine/database.rb b/lib/redmine/database.rb index 073bdf4ba..34365c353 100644 --- a/lib/redmine/database.rb +++ b/lib/redmine/database.rb @@ -40,9 +40,14 @@ module Redmine def postgresql_unaccent? if postgresql? return @postgresql_unaccent unless @postgresql_unaccent.nil? + begin - sql = "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? + sql = + "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 false end |