diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-05-23 12:56:11 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-05-23 12:56:11 +0000 |
commit | 4634e749ee743a8d5123a23d63c18cb0b9350711 (patch) | |
tree | d01f428446e0810f13f899e219211d7b6a00f6bf /app/helpers/application_helper.rb | |
parent | 4a56a6a1b743b4adb5f4de7833efc8caa97a6132 (diff) | |
download | gitlab-ce-4634e749ee743a8d5123a23d63c18cb0b9350711.tar.gz |
CE: Use render_if_exists to hide EE specific codes
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index aa4569500b8..f5d94ad96a1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2,6 +2,11 @@ require 'digest/md5' require 'uri' module ApplicationHelper + # See https://docs.gitlab.com/ee/development/ee_features.html#code-in-app-views + def render_if_exists(partial, locals = {}) + render(partial, locals) if lookup_context.exists?(partial, [], true) + end + # Check if a particular controller is the current one # # args - One or more controller names to check |