diff options
author | Phil Hughes <me@iamphill.com> | 2017-11-01 16:08:06 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-11-06 10:52:02 +0000 |
commit | 054200062f1151fd31138305721d04798e8880b7 (patch) | |
tree | f46976e5dd0eadc5de8c2202571520dfc5b31661 /app/serializers | |
parent | d4ceec9d47a7da5fa17cb6e161ac491e13fcb8bd (diff) | |
download | gitlab-ce-054200062f1151fd31138305721d04798e8880b7.tar.gz |
Multi-file editor fetch log data from a different endpoint
Closes #38360
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/blob_entity.rb | 4 | ||||
-rw-r--r-- | app/serializers/tree_entity.rb | 4 | ||||
-rw-r--r-- | app/serializers/tree_root_entity.rb | 4 |
3 files changed, 4 insertions, 8 deletions
diff --git a/app/serializers/blob_entity.rb b/app/serializers/blob_entity.rb index 56f173e5a27..ad039a2623d 100644 --- a/app/serializers/blob_entity.rb +++ b/app/serializers/blob_entity.rb @@ -3,10 +3,6 @@ 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 diff --git a/app/serializers/tree_entity.rb b/app/serializers/tree_entity.rb index 555e5cf83bd..9f1b485347f 100644 --- a/app/serializers/tree_entity.rb +++ b/app/serializers/tree_entity.rb @@ -3,10 +3,6 @@ class TreeEntity < Grape::Entity expose :id, :path, :name, :mode - expose :last_commit do |tree| - request.project.repository.last_commit_for_path(tree.commit_id, tree.path) - end - expose :icon do |tree| IconsHelper.file_type_icon_class('folder', tree.mode, tree.name) end diff --git a/app/serializers/tree_root_entity.rb b/app/serializers/tree_root_entity.rb index 69702ae1493..496f070ddbd 100644 --- a/app/serializers/tree_root_entity.rb +++ b/app/serializers/tree_root_entity.rb @@ -18,4 +18,8 @@ class TreeRootEntity < Grape::Entity project_tree_path(request.project, File.join(request.ref, parent_tree_path)) end + + expose :last_commit_path do |tree| + logs_file_project_ref_path(request.project, request.ref, tree.path) + end end |