summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2019-06-17 10:21:35 +0000
committerRémy Coutable <remy@rymai.me>2019-06-17 10:21:35 +0000
commitb37ca62686f10dd3c2107ce34c5e1ed800706c67 (patch)
treed3fd9f3c5c16f0094b646bce1ff5e3be451f97f3 /lib
parentc6cf52915b076c1c12bfe3ae3628145bebd8f1a3 (diff)
parentdcba5279b6e4bda905f5fa37a557b94f1fd42ba9 (diff)
downloadgitlab-ce-b37ca62686f10dd3c2107ce34c5e1ed800706c67.tar.gz
Merge branch 'sh-fix-issue-63158' into 'master'
Fix inability to set visibility_level on project via API Closes #63158 See merge request gitlab-org/gitlab-ce!29578
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/visibility_level.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb
index 8f9d5cf1e63..e2787744f09 100644
--- a/lib/gitlab/visibility_level.rb
+++ b/lib/gitlab/visibility_level.rb
@@ -138,5 +138,18 @@ module Gitlab
def visibility=(level)
self[visibility_level_field] = Gitlab::VisibilityLevel.level_value(level)
end
+
+ def visibility_attribute_present?(attributes)
+ visibility_level_attributes.each do |attr|
+ return true if attributes[attr].present?
+ end
+
+ false
+ end
+
+ def visibility_level_attributes
+ [visibility_level_field, visibility_level_field.to_s,
+ :visibility, 'visibility']
+ end
end
end