add Redmine::Database.sqlite? as with postgresql? and postgresql?

git-svn-id: http://svn.redmine.org/redmine/trunk@19711 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2020-04-20 02:06:57 +00:00
parent ea5da4d1be
commit 0421636cd7
2 changed files with 6 additions and 1 deletions

View File

@@ -21,6 +21,11 @@ module Redmine
# Helper module to get information about the Redmine database
module Database
class << self
# Returns true if the database is SQLite
def sqlite?
ActiveRecord::Base.connection.adapter_name =~ /sqlite/i
end
# Returns true if the database is PostgreSQL
def postgresql?
/postgresql/i.match?(ActiveRecord::Base.connection.adapter_name)