summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2015-12-04 18:09:22 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2015-12-04 18:09:22 -0200
commit23c1c70bf0321941ab2b9572a5d0532ed9f58002 (patch)
tree9386f7d3ad81a0499c883ec6ddf781a023904a97 /lib/api/entities.rb
parent9ca41f3ab25bdd98f49541555b23be9c31b1e390 (diff)
parente7e22ece5a63d15c221a73cd544ae83a33770bfe (diff)
downloadgitlab-ce-23c1c70bf0321941ab2b9572a5d0532ed9f58002.tar.gz
Merge branch 'master' into fix-admin-should-be-able-to-add-himself-to-group
Diffstat (limited to 'lib/api/entities.rb')
-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