diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-11-08 01:46:53 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-11-08 01:46:53 +0900 |
commit | 4fac95a64d0c04599af9c762edb94414d85bf42f (patch) | |
tree | b87775aff426603984bc547208860ad147fcff69 /app/serializers | |
parent | 02878cd958557128cd9c22b27bd2fb97a843266b (diff) | |
parent | 396f45ade1dddec36df9861f8a1bb80aabd2ff15 (diff) | |
download | gitlab-ce-4fac95a64d0c04599af9c762edb94414d85bf42f.tar.gz |
Merge branch 'master' into 38464-k8s-apps
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 |