Commit 77eea067 authored by Ruben Davila's avatar Ruben Davila

Expose some attributes only when they're required.

This was breaking the spec spec/features/merge_requests/created_from_fork_spec.rb
which was trying to visit a MergeRequest after the source project was
deleted.
parent 35b12caa
......@@ -62,7 +62,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
format.html { define_discussion_vars }
format.json do
render json: MergeRequestSerializer.new.represent(@merge_request)
render json: MergeRequestSerializer.new.represent(@merge_request, type: :full)
end
format.patch do
......
......@@ -9,7 +9,7 @@ class MergeRequestEntity < IssuableEntity
expose :merge_user_id
expose :merge_when_build_succeeds
expose :rebase_commit_sha
expose :rebase_in_progress?
expose :rebase_in_progress?, if: { type: :full }
expose :source_branch
expose :source_project_id
expose :target_branch
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment