summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-15 09:06:09 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-15 09:06:09 +0000
commit3d13802bc2c9400ea33defdd43bff6d904ee9c4d (patch)
tree44f66ca61ea85130cf210d013b737642ce9c7794 /lib
parent00050519d16f7c0296fa0113de7065a607862501 (diff)
downloadgitlab-ce-3d13802bc2c9400ea33defdd43bff6d904ee9c4d.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab.rb20
1 files changed, 12 insertions, 8 deletions
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