diff options
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 |