diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-04-09 08:20:28 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-04-09 08:20:28 +0000 |
commit | d4cfb7301b5478da3bd4b89c54bfc6d3683d0050 (patch) | |
tree | b1bf103144b3088eebc5cfcfc803821e08aebf04 /app | |
parent | feb149f864d1ecbf5ffb5ba59f538640576c367c (diff) | |
parent | 47b1528abe69f9b584536a3557f23d912b0ecfd8 (diff) | |
download | gitlab-ce-d4cfb7301b5478da3bd4b89c54bfc6d3683d0050.tar.gz |
Merge branch 'sh-fix-issue-45152' into 'master'
Fix undefined method `one?` when pushing to an existing merge request
Closes #45152
See merge request gitlab-org/gitlab-ce!18243
Diffstat (limited to 'app')
-rw-r--r-- | app/views/notify/push_to_merge_request_email.html.haml | 2 | ||||
-rw-r--r-- | app/views/notify/push_to_merge_request_email.text.haml | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/views/notify/push_to_merge_request_email.html.haml b/app/views/notify/push_to_merge_request_email.html.haml index 4c507c08ed7..67744ec1cee 100644 --- a/app/views/notify/push_to_merge_request_email.html.haml +++ b/app/views/notify/push_to_merge_request_email.html.haml @@ -7,7 +7,7 @@ - count = @existing_commits.size %ul %li - - if count.one? + - if count == 1 - commit_id = @existing_commits.first[:short_id] = link_to(commit_id, project_commit_url(@merge_request.target_project, commit_id)) - else diff --git a/app/views/notify/push_to_merge_request_email.text.haml b/app/views/notify/push_to_merge_request_email.text.haml index 553f771f1a6..95759d127e2 100644 --- a/app/views/notify/push_to_merge_request_email.text.haml +++ b/app/views/notify/push_to_merge_request_email.text.haml @@ -4,7 +4,7 @@ \ - if @existing_commits.any? - count = @existing_commits.size - - commits_id = count.one? ? @existing_commits.first[:short_id] : "#{@existing_commits.first[:short_id]}...#{@existing_commits.last[:short_id]}" + - commits_id = count == 1 ? @existing_commits.first[:short_id] : "#{@existing_commits.first[:short_id]}...#{@existing_commits.last[:short_id]}" - commits_text = "#{count} commit".pluralize(count) * #{commits_id} - #{commits_text} from branch `#{@merge_request.target_branch}` |