summaryrefslogtreecommitdiff
path: root/app/serializers/merge_request_for_pipeline_entity.rb
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-03-01 19:05:04 +0900
committerShinya Maeda <shinya@gitlab.com>2019-03-06 16:30:35 +0700
commit50776d2d298c3b6c98e2531f116ca43ba10dcda4 (patch)
tree32e9e41dafa65c0ecff65fa941918e09d268f28c /app/serializers/merge_request_for_pipeline_entity.rb
parentc9e5ce8dbd25203484b43c48f0a55a5d7bf396e8 (diff)
downloadgitlab-ce-50776d2d298c3b6c98e2531f116ca43ba10dcda4.tar.gz
Expose merge request entity for pipelines
Add preload Fix ok Write tests test only postgresql ok add more test ; Improve wording Add changelog Fix
Diffstat (limited to 'app/serializers/merge_request_for_pipeline_entity.rb')
-rw-r--r--app/serializers/merge_request_for_pipeline_entity.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/serializers/merge_request_for_pipeline_entity.rb b/app/serializers/merge_request_for_pipeline_entity.rb
new file mode 100644
index 00000000000..7779ddfd65a
--- /dev/null
+++ b/app/serializers/merge_request_for_pipeline_entity.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class MergeRequestForPipelineEntity < Grape::Entity
+ include RequestAwareEntity
+
+ expose :iid
+
+ expose :path do |merge_request|
+ project_merge_request_path(merge_request.project, merge_request)
+ end
+
+ expose :title
+ expose :source_branch
+ expose :source_branch_path
+ expose :target_branch
+ expose :target_branch_path
+end