diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-04-20 02:06:57 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-04-20 02:06:57 +0000 |
commit | 0421636cd7622d9b1716451debd3d84ff0c34ac8 (patch) | |
tree | 2e9077a25dbd1ab12758ae1398dffdc24bbe16a2 | |
parent | ea5da4d1be1e4c6f8465ef731d9d22d3c98d481b (diff) | |
download | redmine-0421636cd7622d9b1716451debd3d84ff0c34ac8.tar.gz redmine-0421636cd7622d9b1716451debd3d84ff0c34ac8.zip |
add Redmine::Database.sqlite? as with postgresql? and postgresql?
git-svn-id: http://svn.redmine.org/redmine/trunk@19711 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | lib/redmine/database.rb | 5 | ||||
-rw-r--r-- | test/test_helper.rb | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/redmine/database.rb b/lib/redmine/database.rb index 26be1095f..073bdf4ba 100644 --- a/lib/redmine/database.rb +++ b/lib/redmine/database.rb @@ -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) diff --git a/test/test_helper.rb b/test/test_helper.rb index 703af723c..1acfacf74 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -186,7 +186,7 @@ class ActiveSupport::TestCase end def sqlite? - ActiveRecord::Base.connection.adapter_name =~ /sqlite/i + Redmine::Database.sqlite? end def mysql? |