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-10-31 21:06:53 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-31 21:06:53 +0300
commit996f700997805b3590da8d8afdd19d193989078a (patch)
treefb555d6012ea1a6f018694b62bba5c68c8c623e1 /app/models/concerns/subscribable.rb
parent083d64c6468a070ae7b0b406ead8d87da27d1d22 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/concerns/subscribable.rb')
-rw-r--r--app/models/concerns/subscribable.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/concerns/subscribable.rb b/app/models/concerns/subscribable.rb
index 92a5c1112af..33e9e0e38fb 100644
--- a/app/models/concerns/subscribable.rb
+++ b/app/models/concerns/subscribable.rb
@@ -59,6 +59,14 @@ module Subscribable
.update(subscribed: false)
end
+ def set_subscription(user, desired_state, project = nil)
+ if desired_state
+ subscribe(user, project)
+ else
+ unsubscribe(user, project)
+ end
+ end
+
private
def unsubscribe_from_other_levels(user, project)