From 6186ac2c3d0db6932993ac681cbed6f453499503 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Sat, 12 Nov 2016 10:05:57 +0100 Subject: [PATCH] Expose created_at and updated_at in pipeline entity --- app/serializers/pipeline_entity.rb | 2 ++ app/serializers/request_aware_entity.rb | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/serializers/pipeline_entity.rb b/app/serializers/pipeline_entity.rb index 24fe1602c2d..08346b4ed77 100644 --- a/app/serializers/pipeline_entity.rb +++ b/app/serializers/pipeline_entity.rb @@ -64,6 +64,8 @@ class PipelineEntity < Grape::Entity pipeline.project, pipeline.id) end + expose :created_at, :updated_at + def created_exposure? !incremental? || created? end diff --git a/app/serializers/request_aware_entity.rb b/app/serializers/request_aware_entity.rb index 7a096d9d5a8..e159d750cb7 100644 --- a/app/serializers/request_aware_entity.rb +++ b/app/serializers/request_aware_entity.rb @@ -9,10 +9,6 @@ module RequestAwareEntity @options.fetch(:request) end - def current_user - @options.fetch(:current_user) - end - def can?(object, action, subject) Ability.allowed?(object, action, subject) end