summaryrefslogtreecommitdiff
path: root/app/services/merge_requests
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2016-06-21 17:54:41 +0100
committerSean McGivern <sean@gitlab.com>2016-06-21 17:59:20 +0100
commitb2f60bb9a118c366ad462241bd4842c52d872d5f (patch)
treec35dd2323dbd6af967dbcb7ba261c6e3debca458 /app/services/merge_requests
parent707e8d434da9dd8ee07ac2cb8b9556c132aa52ca (diff)
downloadgitlab-ce-b2f60bb9a118c366ad462241bd4842c52d872d5f.tar.gz
Fix auto-MR-close text from branch namefix-auto-mr-close
Rails's form helpers use the `$attr_before_type_cast` method where available, and this value only appears to be updated on assignment, not when the object is mutated in some other way: [1] pry(main)> mr = MergeRequest.new => #<MergeRequest:0x007fcf28395d88 ...> [2] pry(main)> mr.description = 'foo' => "foo" [3] pry(main)> mr.description << ' bar' => "foo bar" [4] pry(main)> mr.description => "foo bar" [5] pry(main)> mr.description_before_type_cast => "foo" [6] pry(main)> mr.description += ' bar' => "foo bar bar" [7] pry(main)> mr.description_before_type_cast => "foo bar bar"
Diffstat (limited to 'app/services/merge_requests')
-rw-r--r--app/services/merge_requests/build_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/merge_requests/build_service.rb b/app/services/merge_requests/build_service.rb
index 1b48899bb0a..7fe57747265 100644
--- a/app/services/merge_requests/build_service.rb
+++ b/app/services/merge_requests/build_service.rb
@@ -83,7 +83,7 @@ module MergeRequests
closes_issue = "Closes ##{iid}"
if merge_request.description.present?
- merge_request.description << closes_issue.prepend("\n")
+ merge_request.description += closes_issue.prepend("\n")
else
merge_request.description = closes_issue
end