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"
If a branch starts with an issue's IID, followed by a hyphen, the
description will be updated to say that is closes the issue. This also
updates the title of the merge request to 'Resolves "$issue-title"', as
long as:
- There is more than one commit in the merge request (if there is only
one commit, the commit's title will be used as before)
- The issue's IID is valid for the project
Given the branch name 'mep-mep' with an iid being 1,
the current way, master's way, would yield a branch name of
1-mep-mep. The problem for larger projects however would be that
a developer might forget what iid the issue was.
When this developer would try to tab complete it would:
- Or result in 20+ branches possibly
- Or start with the wrong digit, try again with digit++
- Would see 20 branches, repeat
Thus the obvious way of solving this is letting the dev tab complete
on the issue title, which is easier to remember.
* fix 500 error when no parent for initial commit
* fix link from diff files to wrong commit
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>