diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2019-03-04 11:20:37 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-03-04 11:20:37 +0300 |
commit | ec7835946a0c981e9b263d2840e68f16eb1b3789 (patch) | |
tree | f02fd29d0367b55a2eb5f701015d73c28a63413e /lib | |
parent | 615c14b28990489d99371b7ffdb57fe54d463e64 (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.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/gon_helper.rb | 1 |
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 |