Skip to content

Commit

Permalink
[api] Do not use succeed + surround
Browse files Browse the repository at this point in the history
`succeed` appends a string to the end of a Haml block, and `surround`
appends strings to the end and the beginning. Because of that, if we
already need to use `surround`, it doesn't make sense to use `succeed`
as well. It is also more readable, as what we want is just a comma after
the closing parenthesis.
  • Loading branch information
Ana06 committed Jun 22, 2018
1 parent aea2a13 commit 4cebe3b
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
This request supersedes:
- superseding.each_with_index do |bs_request, index|
= link_to "request #{bs_request.number}", request_show_path(number: bs_request.number)
= succeed (', ' if index < superseding.length - 1) do
= surround '(', ')' do
= link_to('Show diff', request_show_path(number: bs_request.superseded_by, diff_to_superseded: bs_request.number))
= surround '(', ")#{', ' if index < superseding.length - 1 }" do
= link_to('Show diff', request_show_path(number: bs_request.superseded_by, diff_to_superseded: bs_request.number))
- if superseded_by.present?
.grid_16.alpha.omega.box-invisible
.ui-state-info.ui-corner-all.ui-widget-shadow.padding-10pt#request-superseded-by-hint
Expand Down

0 comments on commit 4cebe3b

Please sign in to comment.