diff options
Diffstat (limited to 'app/serializers/pipeline_entity.rb')
-rw-r--r-- | app/serializers/pipeline_entity.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/serializers/pipeline_entity.rb b/app/serializers/pipeline_entity.rb index ba8f4fffe02..c3ddbb88c9c 100644 --- a/app/serializers/pipeline_entity.rb +++ b/app/serializers/pipeline_entity.rb @@ -25,7 +25,7 @@ class PipelineEntity < Grape::Entity expose :flags do expose :stuck?, as: :stuck expose :auto_devops_source?, as: :auto_devops - expose :merge_request_event?, as: :merge_request + expose :merge_request?, as: :merge_request expose :has_yaml_errors?, as: :yaml_errors expose :can_retry?, as: :retryable expose :can_cancel?, as: :cancelable @@ -59,11 +59,11 @@ class PipelineEntity < Grape::Entity expose :tag?, as: :tag expose :branch?, as: :branch - expose :merge_request_event?, as: :merge_request + expose :merge_request?, as: :merge_request end expose :commit, using: CommitEntity - expose :merge_request_event_type, if: -> (pipeline, _) { pipeline.merge_request_event? } + expose :merge_request_event_type, if: -> (pipeline, _) { pipeline.merge_request? } expose :source_sha, if: -> (pipeline, _) { pipeline.merge_request_pipeline? } expose :target_sha, if: -> (pipeline, _) { pipeline.merge_request_pipeline? } expose :yaml_errors, if: -> (pipeline, _) { pipeline.has_yaml_errors? } @@ -104,7 +104,7 @@ class PipelineEntity < Grape::Entity end def has_presentable_merge_request? - pipeline.triggered_by_merge_request? && + pipeline.merge_request? && can?(request.current_user, :read_merge_request, pipeline.merge_request) end |