Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
a32dd93a
Commit
a32dd93a
authored
Nov 29, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix started_at check
parent
94a74e79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
5 deletions
+1
-5
app/serializers/analytics_build_entity.rb
app/serializers/analytics_build_entity.rb
+1
-5
No files found.
app/serializers/analytics_build_entity.rb
View file @
a32dd93a
...
@@ -13,7 +13,7 @@ class AnalyticsBuildEntity < Grape::Entity
...
@@ -13,7 +13,7 @@ class AnalyticsBuildEntity < Grape::Entity
end
end
expose
:duration
,
as: :total_time
do
|
build
|
expose
:duration
,
as: :total_time
do
|
build
|
build
_started?
(
build
)
?
distance_of_time_as_hash
(
build
.
duration
.
to_f
)
:
{}
build
.
duration
?
distance_of_time_as_hash
(
build
.
duration
.
to_f
)
:
{}
end
end
expose
:branch
do
expose
:branch
do
...
@@ -37,8 +37,4 @@ class AnalyticsBuildEntity < Grape::Entity
...
@@ -37,8 +37,4 @@ class AnalyticsBuildEntity < Grape::Entity
def
url_to
(
route
,
build
,
id
=
nil
)
def
url_to
(
route
,
build
,
id
=
nil
)
public_send
(
"
#{
route
}
_url"
,
build
.
project
.
namespace
,
build
.
project
,
id
||
build
)
public_send
(
"
#{
route
}
_url"
,
build
.
project
.
namespace
,
build
.
project
,
id
||
build
)
end
end
def
build_started?
(
build
)
build
.
duration
&&
build
[
:started_at
]
end
end
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