From 9a20ff1c99e0e73883d32438e50772635f0aed27 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Fri, 17 Mar 2017 14:16:47 +0100 Subject: Added Gitlab::Database.config This returns the ActiveRecord configuration for the current environment. While CE doesn't use this very often, EE will use it in a few places for the database load balancing code. I'm adding this to CE so we don't end up with merge conflicts in this file. --- lib/gitlab/database.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb index f3f417c1a63..63b8d0d3b9d 100644 --- a/lib/gitlab/database.rb +++ b/lib/gitlab/database.rb @@ -5,8 +5,12 @@ module Gitlab # http://dev.mysql.com/doc/refman/5.7/en/integer-types.html MAX_INT_VALUE = 2147483647 + def self.config + ActiveRecord::Base.configurations[Rails.env] + end + def self.adapter_name - ActiveRecord::Base.configurations[Rails.env]['adapter'] + config['adapter'] end def self.mysql? -- cgit v1.2.1