diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-06-22 11:50:55 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-06-22 11:50:55 +0300 |
commit | f516b8d0d7c8284ed948a26d1476856c28ad9bc7 (patch) | |
tree | 12d8f849cb9a357e1a5546a7c5f1a196d3afa833 /app/serializers/blob_entity.rb | |
parent | 397a0a1db2b5836108640a80636060bc0e654986 (diff) |
Expose last_commit information for tree and blob when serialized
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/serializers/blob_entity.rb')
-rw-r--r-- | app/serializers/blob_entity.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/serializers/blob_entity.rb b/app/serializers/blob_entity.rb index f05416be65b..e826d657030 100644 --- a/app/serializers/blob_entity.rb +++ b/app/serializers/blob_entity.rb @@ -3,6 +3,10 @@ class BlobEntity < Grape::Entity expose :id, :path, :name, :mode + expose :last_commit do |blob| + request.project.repository.last_commit_for_path(blob.commit_id, blob.path) + end + expose :icon do |blob| IconsHelper.file_type_icon_class('file', blob.mode, blob.name) end |