summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-08-23 16:24:01 +0200
committerDouwe Maan <douwe@selenight.nl>2017-08-23 16:24:01 +0200
commit5f2ff6bf7288a9d28a0c28a7b02098944c402045 (patch)
tree051d44e7586b928d9e4695fca5710c9b855cc461
parent97a2b5332611af1b280883d32dcdb214df418c71 (diff)
downloadgitlab-ce-bpj-blob-viewer-json.tar.gz
Fix BlobBasicEntity when used to render a tree blobbpj-dm-blob-viewer-jsonbpj-blob-viewer-json
-rw-r--r--app/serializers/blob_basic_entity.rb5
-rw-r--r--app/serializers/blob_entity.rb5
2 files changed, 6 insertions, 4 deletions
diff --git a/app/serializers/blob_basic_entity.rb b/app/serializers/blob_basic_entity.rb
index 24c81c3bb6f..3a630bbcca1 100644
--- a/app/serializers/blob_basic_entity.rb
+++ b/app/serializers/blob_basic_entity.rb
@@ -1,10 +1,7 @@
class BlobBasicEntity < Grape::Entity
include RequestAwareEntity
- expose :id, :path, :name, :mode, :extension, :mime_type, :file_type
-
- expose :raw_size, as: :size
- expose :raw_binary?, as: :binary
+ expose :id, :path, :name, :mode
expose :last_commit do |blob|
request.project.repository.last_commit_for_path(blob.commit_id, blob.path)
diff --git a/app/serializers/blob_entity.rb b/app/serializers/blob_entity.rb
index c9b87eea6c7..0930d6d3526 100644
--- a/app/serializers/blob_entity.rb
+++ b/app/serializers/blob_entity.rb
@@ -1,4 +1,9 @@
class BlobEntity < BlobBasicEntity
+ expose :extension, :mime_type, :file_type
+
+ expose :raw_size, as: :size
+ expose :raw_binary?, as: :binary
+
expose :simple_viewer, :rich_viewer, :auxiliary_viewer, using: BlobViewerEntity
expose :stored_externally?, as: :stored_externally