Skip to content
Snippets Groups Projects
Commit b2f60bb9 authored by Sean McGivern's avatar Sean McGivern
Browse files

Fix auto-MR-close text from branch name

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"
parent 707e8d43
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -13,6 +13,7 @@ v 8.9.0 (unreleased)
- Fix endless redirections when accessing user OAuth applications when they are disabled
- Allow enabling wiki page events from Webhook management UI
- Bump rouge to 1.11.0
- Fix MR-auto-close text added to description
- Fix issue with arrow keys not working in search autocomplete dropdown
- Fix an issue where note polling stopped working if a window was in the
background during a refresh.
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment