gitlab-org--gitlab-foss/lib/gitlab/database.rb
Yorick Peterse 85c6a3743a Added methods for detecting MySQL/PostgreSQL
These two methods remove the need for manually going into
ActiveRecord::Base.connection all over the place.
2015-10-07 23:32:14 +02:00

11 lines
247 B
Ruby

module Gitlab
module Database
def self.mysql?
ActiveRecord::Base.connection.adapter_name.downcase == 'mysql'
end
def self.postgresql?
ActiveRecord::Base.connection.adapter_name.downcase == 'postgresql'
end
end
end