From 3d13802bc2c9400ea33defdd43bff6d904ee9c4d Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 15 Oct 2019 09:06:09 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- lib/gitlab.rb | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'lib/gitlab.rb') diff --git a/lib/gitlab.rb b/lib/gitlab.rb index b337f5cbf2c..0cc9a6a5fb1 100644 --- a/lib/gitlab.rb +++ b/lib/gitlab.rb @@ -65,14 +65,18 @@ module Gitlab def self.ee? @is_ee ||= - if ENV['IS_GITLAB_EE'] && !ENV['IS_GITLAB_EE'].empty? - Gitlab::Utils.to_boolean(ENV['IS_GITLAB_EE']) - else - # We may use this method when the Rails environment is not loaded. This - # means that checking the presence of the License class could result in - # this method returning `false`, even for an EE installation. - root.join('ee/app/models/license.rb').exist? - end + # We use this method when the Rails environment is not loaded. This + # means that checking the presence of the License class could result in + # this method returning `false`, even for an EE installation. + # + # The `IS_GITLAB_EE` is always `string` or `nil` + # Thus the nil or empty string will result + # in using default value: true + # + # The behavior needs to be synchronised with + # config/helpers/is_ee_env.js + root.join('ee/app/models/license.rb').exist? && + (ENV['IS_GITLAB_EE'].to_s.empty? || Gitlab::Utils.to_boolean(ENV['IS_GITLAB_EE'])) end def self.ee -- cgit v1.2.3