diff options
author | James Lopez <james@jameslopez.es> | 2016-11-14 14:53:06 +0100 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-11-17 08:22:58 +0100 |
commit | 3b179bc37b940521522af6d8bf6762c2a9a0e251 (patch) | |
tree | b77cf724e7325928b73e04f80bde6bfd4dd431b1 /app/serializers/analytics_build_entity.rb | |
parent | 81d0146c4cf0d34b1b81da770483ed864482149c (diff) | |
download | gitlab-ce-3b179bc37b940521522af6d8bf6762c2a9a0e251.tar.gz |
WIP - refactored events to use build serializer, related spec passing
Diffstat (limited to 'app/serializers/analytics_build_entity.rb')
-rw-r--r-- | app/serializers/analytics_build_entity.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/serializers/analytics_build_entity.rb b/app/serializers/analytics_build_entity.rb index 7ed89f1f347..a07f0beccd4 100644 --- a/app/serializers/analytics_build_entity.rb +++ b/app/serializers/analytics_build_entity.rb @@ -2,17 +2,23 @@ class AnalyticsBuildEntity < Grape::Entity include RequestAwareEntity expose :name + expose :id expose :ref, as: :branch expose :short_sha expose :started_at, as: :date expose :duration, as: :total_time + expose :author, using: UserEntity - expose :url do |build| - url_to(:namespace_project_build, build) + expose :branch do + expose :ref, as: :name + + expose :url do |build| + url_to(:namespace_project_tree, build, build.ref) + end end - expose :branch_url do |build| - url_to(:namespace_project_tree, build, build.ref) + expose :url do |build| + url_to(:namespace_project_build, build) end expose :commit_url do |build| |