Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-28 18:06:57 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-28 18:06:57 +0300
commit7cdd70dcec27402e89e65451b4b1feb75b5eb267 (patch)
tree1691c8e1afd469fa426ecf5bc127de8df16d4855 /lib/gitlab/visibility_level.rb
parent79348faced5e7e62103ad27f6a6594dfdca463e2 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/visibility_level.rb')
-rw-r--r--lib/gitlab/visibility_level.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb
index e2787744f09..a1d462ea9f5 100644
--- a/lib/gitlab/visibility_level.rb
+++ b/lib/gitlab/visibility_level.rb
@@ -115,6 +115,18 @@ module Gitlab
end
end
+ def visibility_level_decreased?
+ return false unless visibility_level_previous_changes
+
+ before, after = visibility_level_previous_changes
+
+ before && after && after < before
+ end
+
+ def visibility_level_previous_changes
+ previous_changes[:visibility_level]
+ end
+
def private?
visibility_level_value == PRIVATE
end