diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-05-18 20:23:00 -0500 |
---|---|---|
committer | Jacob Schatz <jschatz1@gmail.com> | 2016-05-25 08:15:20 -0400 |
commit | 77ca4a675ac7f8684f0b7c10592140365fc13a2d (patch) | |
tree | ecf6834c63c03269bf0a1ee03797f89aafffb0d7 | |
parent | bc38bfada7eb0f99be02399fcee6672011f29c79 (diff) | |
download | gitlab-ce-77ca4a675ac7f8684f0b7c10592140365fc13a2d.tar.gz |
Make conditional a guard clause
-rw-r--r-- | app/helpers/todos_helper.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 27f33b3eded..b9d7edb4185 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -38,11 +38,11 @@ module TodosHelper end def todo_target_state_pill(todo) - if show_todo_state?(todo) - content_tag(:span, nil, class: 'target-status') do - content_tag(:span, nil, class: "status-box status-box-#{todo.target.state.dasherize}") do - todo.target.state.capitalize - end + return unless show_todo_state?(todo) + + content_tag(:span, nil, class: 'target-status') do + content_tag(:span, nil, class: "status-box status-box-#{todo.target.state.dasherize}") do + todo.target.state.capitalize end end end |