diff options
author | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2014-11-03 11:52:33 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2014-11-03 11:52:33 +0000 |
commit | d7c50b4a95b5530ae0e2f5249cfd9a419dd940c6 (patch) | |
tree | ebecae4f45d5c5e01bcf39807b87e90e353cecf6 /lib/api/entities.rb | |
parent | fe610ff576fa5bac0b875309f137b471e7fe7e50 (diff) | |
parent | 9b251bd1cc1ed551aad9bc67ca2743b8e2666c6e (diff) | |
download | gitlab-ce-d7c50b4a95b5530ae0e2f5249cfd9a419dd940c6.tar.gz |
Merge branch 'api-events-username' into 'master'
Expose author username in project events API
Fixes gitlab/gitlabhq#1476
See merge request !1236
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index d19caf5b23a..4e7b1c91c4e 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -183,6 +183,12 @@ module API expose :target_id, :target_type, :author_id expose :data, :target_title expose :created_at + + expose :author_username do |event, options| + if event.author + event.author.username + end + end end class Namespace < Grape::Entity |