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:
authorHeinrich Lee Yu <heinrich@gitlab.com>2018-11-30 07:03:35 +0300
committerHeinrich Lee Yu <hleeyu@gmail.com>2018-12-20 02:28:28 +0300
commit95aae95a1cbb55facd127c74d6c044b13533f3fe (patch)
tree6ecf27a219ee09f9e9d294d8304df2cb93c4da3d /app/serializers/issuable_sidebar_extras_entity.rb
parent48d2c02efe7697914591d7381ce1c72d68eed336 (diff)
Code style changes and refactor
Diffstat (limited to 'app/serializers/issuable_sidebar_extras_entity.rb')
-rw-r--r--app/serializers/issuable_sidebar_extras_entity.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/serializers/issuable_sidebar_extras_entity.rb b/app/serializers/issuable_sidebar_extras_entity.rb
new file mode 100644
index 00000000000..d60253564e1
--- /dev/null
+++ b/app/serializers/issuable_sidebar_extras_entity.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class IssuableSidebarExtrasEntity < Grape::Entity
+ include RequestAwareEntity
+ include TimeTrackableEntity
+
+ expose :participants, using: ::API::Entities::UserBasic do |issuable|
+ issuable.participants(request.current_user)
+ end
+
+ expose :subscribed do |issuable|
+ issuable.subscribed?(request.current_user, issuable.project)
+ end
+end