diff options
author | Nick Thomas <nick@gitlab.com> | 2017-06-07 16:45:36 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2017-06-07 16:45:36 +0300 |
commit | 774053a377c5ab140d612aa18fbe4cbcedf87ea9 (patch) | |
tree | c4e36238dd0567dd24eb3de5d38ccef400ef25c2 /app/serializers | |
parent | 615075e18f39bc8a11b9850497380a67719d8713 (diff) | |
parent | d030393adb414a9264623f403d2b6f39adcf3b4e (diff) |
Merge remote-tracking branch 'ce/master' into ce-to-ee-2017-06-07
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/entity_date_helper.rb | 2 | ||||
-rw-r--r-- | app/serializers/pipeline_details_entity.rb | 7 | ||||
-rw-r--r-- | app/serializers/pipeline_serializer.rb | 7 | ||||
-rw-r--r-- | app/serializers/user_entity.rb | 5 |
4 files changed, 20 insertions, 1 deletions
diff --git a/app/serializers/entity_date_helper.rb b/app/serializers/entity_date_helper.rb index 9607ad55a8b..71d9a65fb58 100644 --- a/app/serializers/entity_date_helper.rb +++ b/app/serializers/entity_date_helper.rb @@ -4,7 +4,7 @@ module EntityDateHelper def interval_in_words(diff) return 'Not started' unless diff - "#{distance_of_time_in_words(Time.now, diff)} ago" + distance_of_time_in_words(Time.now, diff, scope: 'datetime.time_ago_in_words') end # Converts seconds into a hash such as: diff --git a/app/serializers/pipeline_details_entity.rb b/app/serializers/pipeline_details_entity.rb index 577b0555c92..b1cda1b127a 100644 --- a/app/serializers/pipeline_details_entity.rb +++ b/app/serializers/pipeline_details_entity.rb @@ -1,5 +1,6 @@ class PipelineDetailsEntity < PipelineEntity expose :details do +<<<<<<< HEAD expose :stages, using: StageEntity expose :artifacts, using: BuildArtifactEntity expose :manual_actions, using: BuildActionEntity @@ -7,4 +8,10 @@ class PipelineDetailsEntity < PipelineEntity expose :triggered_by_pipeline, as: :triggered_by, with: TriggeredPipelineEntity expose :triggered_pipelines, as: :triggered, using: TriggeredPipelineEntity +======= + expose :legacy_stages, as: :stages, using: StageEntity + expose :artifacts, using: BuildArtifactEntity + expose :manual_actions, using: BuildActionEntity + end +>>>>>>> ce/master end diff --git a/app/serializers/pipeline_serializer.rb b/app/serializers/pipeline_serializer.rb index 3eb53c64247..bd122372754 100644 --- a/app/serializers/pipeline_serializer.rb +++ b/app/serializers/pipeline_serializer.rb @@ -13,16 +13,23 @@ class PipelineSerializer < BaseSerializer def represent(resource, opts = {}) if resource.is_a?(ActiveRecord::Relation) + resource = resource.preload([ :retryable_builds, :cancelable_statuses, :trigger_requests, :project, +<<<<<<< HEAD { triggered_by_pipeline: [:project, :user] }, { triggered_pipelines: [:project, :user] }, { pending_builds: :project }, { manual_actions: :project }, { artifacts: :project } +======= + :manual_actions, + :artifacts, + { pending_builds: :project } +>>>>>>> ce/master ]) end diff --git a/app/serializers/user_entity.rb b/app/serializers/user_entity.rb index 43754ea94f7..876512b12dc 100644 --- a/app/serializers/user_entity.rb +++ b/app/serializers/user_entity.rb @@ -1,2 +1,7 @@ class UserEntity < API::Entities::UserBasic + include RequestAwareEntity + + expose :path do |user| + user_path(user) + end end |