summaryrefslogtreecommitdiff
path: root/app/serializers/blob_entity.rb
diff options
context:
space:
mode:
authorFelipe Artur <fcardozo@gitlab.com>2018-06-21 12:22:40 +0000
committerTim Zallmann <tzallmann@gitlab.com>2018-06-21 12:22:40 +0000
commit3e66795ef1ff1228906239763910b051d8afcc37 (patch)
treedf6424d9ec008f5d1da455f8465681b371c4a11e /app/serializers/blob_entity.rb
parent14e35ac9b19d358d84e0cfd167f74036937285b6 (diff)
downloadgitlab-ce-3e66795ef1ff1228906239763910b051d8afcc37.tar.gz
Changes tab VUE refactoring
Diffstat (limited to 'app/serializers/blob_entity.rb')
-rw-r--r--app/serializers/blob_entity.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/serializers/blob_entity.rb b/app/serializers/blob_entity.rb
index ad039a2623d..b501fd5e964 100644
--- a/app/serializers/blob_entity.rb
+++ b/app/serializers/blob_entity.rb
@@ -3,11 +3,13 @@ class BlobEntity < Grape::Entity
expose :id, :path, :name, :mode
+ expose :readable_text?, as: :readable_text
+
expose :icon do |blob|
IconsHelper.file_type_icon_class('file', blob.mode, blob.name)
end
- expose :url do |blob|
+ expose :url, if: -> (*) { request.respond_to?(:ref) } do |blob|
project_blob_path(request.project, File.join(request.ref, blob.path))
end
end