BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
f516b8d0
Unverified
Commit
f516b8d0
authored
Jun 22, 2017
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose last_commit information for tree and blob when serialized
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
397a0a1d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
blob_entity.rb
app/serializers/blob_entity.rb
+4
-0
tree_entity.rb
app/serializers/tree_entity.rb
+4
-0
No files found.
app/serializers/blob_entity.rb
View file @
f516b8d0
...
...
@@ -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
...
...
app/serializers/tree_entity.rb
View file @
f516b8d0
...
...
@@ -3,6 +3,10 @@ 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment