Commit 2c1cbde7 authored by Shinya Maeda's avatar Shinya Maeda

Use respond_to

parent 6361e8e7
%h4.prepend-top-0
Secret variables
= link_to icon('question-circle'), help_page_path('ci/variables/README', anchor: 'secret-variables'), target: '_blank'
- if @variable.is_a?(Ci::VariablePresenter) && @project.feature_available?(:variable_environment_scope)
- if @variable.respond_to?(:environment_scope) && @project.feature_available?(:variable_environment_scope)
%p
These variables will be set to environment by the runner, and could be protected by exposing only to protected branches or tags, or some particular environments.
- else
......
......@@ -7,7 +7,7 @@
.form-group
= f.label :value, "Value", class: "label-light"
= f.text_area :value, class: "form-control", placeholder: @variable.placeholder
- if @variable.is_a?(Ci::VariablePresenter)
- if @variable.respond_to?(:environment_scope)
= render 'projects/variables/ee/environment_scope', f: f
.form-group
.checkbox
......
......@@ -9,7 +9,7 @@
%th Key
%th Value
%th Protected
- if @variable.is_a?(Ci::VariablePresenter) && @project.feature_available?(:variable_environment_scope)
- if @variable.respond_to?(:environment_scope) && @project.feature_available?(:variable_environment_scope)
%th Environment scope
%th
%tbody
......@@ -19,7 +19,7 @@
%td.variable-key= variable.key
%td.variable-value{ "data-value" => variable.value }******
%td.variable-protected= Gitlab::Utils.boolean_to_yes_no(variable.protected)
- if @variable.is_a?(Ci::VariablePresenter) && @project.feature_available?(:variable_environment_scope)
- if @variable.respond_to?(:environment_scope) && @project.feature_available?(:variable_environment_scope)
%td.variable-environment-scope= variable.environment_scope
%td.variable-menu
= link_to variable.edit_path, class: "btn btn-transparent btn-variable-edit" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment