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?