Commit 570813d6 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Detect if we should expose environment_scope by

checking against if it's responding to environment_scope
directly. See:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12936#note_36822301
parent 4d027dc6
......@@ -863,11 +863,9 @@ module API
# EE
expose :environment_scope, if: ->(variable, options) {
if variable.respond_to?(:project)
variable.project
else
variable.group
end.feature_available?(:variable_environment_scope)
if variable.respond_to?(:environment_scope)
variable.project.feature_available?(:variable_environment_scope)
end
}
end
......
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