summaryrefslogtreecommitdiff
path: root/lib/gitlab.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab.rb')
-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..ad8e693ccbc 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 `FOSS_ONLY` is always `string` or `nil`
+ # Thus the nil or empty string will result
+ # in using default value: false
+ #
+ # The behavior needs to be synchronised with
+ # config/helpers/is_ee_env.js
+ root.join('ee/app/models/license.rb').exist? &&
+ !%w[true 1].include?(ENV['FOSS_ONLY'].to_s)
end
def self.ee