diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-10-31 12:08:45 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-10-31 12:08:45 +0200 |
commit | ef9f8677e65b4b791550daad4ebff8ae50c2f0d2 (patch) | |
tree | 0066343ba655353cca1f77d65c8d1065823638e6 /lib | |
parent | 80059cb5231a557d0e86653a53e27ce19f62b488 (diff) | |
download | gitlab-ce-ef9f8677e65b4b791550daad4ebff8ae50c2f0d2.tar.gz |
Expose author username in project events API
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib')
-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 |