Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2019-03-04 11:20:37 +0300
committerPhil Hughes <me@iamphill.com>2019-03-04 11:20:37 +0300
commitec7835946a0c981e9b263d2840e68f16eb1b3789 (patch)
treef02fd29d0367b55a2eb5f701015d73c28a63413e /lib
parent615c14b28990489d99371b7ffdb57fe54d463e64 (diff)
Creates a function to check if repo is EE
Adds EE information to gon Creates a global vue mixin
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab.rb4
-rw-r--r--lib/gitlab/gon_helper.rb1
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/gitlab.rb b/lib/gitlab.rb
index e073450283b..f42ca5a9cd6 100644
--- a/lib/gitlab.rb
+++ b/lib/gitlab.rb
@@ -58,6 +58,10 @@ module Gitlab
Rails.env.development? || org? || com?
end
+ def self.ee?
+ Object.const_defined?(:License)
+ end
+
def self.process_name
return 'sidekiq' if Sidekiq.server?
return 'console' if defined?(Rails::Console)
diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb
index 3235d3ccc4e..e00309e7946 100644
--- a/lib/gitlab/gon_helper.rb
+++ b/lib/gitlab/gon_helper.rb
@@ -25,6 +25,7 @@ module Gitlab
gon.test_env = Rails.env.test?
gon.suggested_label_colors = LabelsHelper.suggested_colors
gon.first_day_of_week = current_user&.first_day_of_week || Gitlab::CurrentSettings.first_day_of_week
+ gon.ee = Gitlab.ee?
if current_user
gon.current_user_id = current_user.id