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
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-12-04 14:21:06 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-12-04 14:22:50 +0300
commit3227a5ead22c90873794b0c0e4c788436283fb3e (patch)
tree573a6014fcd2d70722f6cc04a8871aef718638c5 /lib
parent0ccd7de7f369d98615833867abe84142bcc25193 (diff)
Extent Event and Note API
* add note to Events API * add author section to Events API * add noteable_id and noteable_type to Notes API Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 9f337bc3cc6..96b73df6af9 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -194,6 +194,7 @@ module API
expose :author, using: Entities::UserBasic
expose :created_at
expose :system?, as: :system
+ expose :noteable_id, :noteable_type
# upvote? and downvote? are deprecated, always return false
expose :upvote?, as: :upvote
expose :downvote?, as: :downvote
@@ -224,6 +225,8 @@ module API
expose :target_id, :target_type, :author_id
expose :data, :target_title
expose :created_at
+ expose :note, using: Entities::Note, if: ->(event, options) { event.note? }
+ expose :author, using: Entities::UserBasic, if: ->(event, options) { event.author }
expose :author_username do |event, options|
if event.author