summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-07-21 12:13:50 +0200
committerZ.J. van de Weg <zegerjan@gitlab.com>2016-08-10 10:51:59 +0200
commit95c1cb9f2e9f7e3dc1e0458e0e7fd7c4fdb82a77 (patch)
treee778285ca2ca7a2da0c61b8a797319e68456d7df /lib/api/entities.rb
parent4ef6b1fbb31d4ab0b91c2bb3bd99ce18dc40b229 (diff)
downloadgitlab-ce-zj-refactor-merge-params.tar.gz
Create remove_source_branch field on MergeRequestzj-refactor-merge-params
A few releases back a checkbox was introduced to remove the source branch once the MR was merged. With this checkbox the key `force_remove_source_branch` was introduced, while `should_remove_source_branch` was already introduced at the time that merge when build succeeds was implemented. To me this warranted the creation of a field `remove_source_branch`. A migration has been added, and tested on PG only at this time. MySQL should be done still. Also, this commit updates the style for the API docs on MR's. This was done as I wanted to be a good boyscout, hope the MR stays foccussed enough.
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index e5b00dc45a5..f8bb7d215ee 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -218,8 +218,8 @@ module API
merge_request.subscribed?(options[:current_user])
end
expose :user_notes_count
- expose :should_remove_source_branch?, as: :should_remove_source_branch
- expose :force_remove_source_branch?, as: :force_remove_source_branch
+ expose(:should_remove_source_branch?) { |mr| mr.remove_source_branch }
+ expose(:force_remove_source_branch?) { |mr| mr.remove_source_branch }
end
class MergeRequestChanges < MergeRequest