Make conditional a guard clause

This commit is contained in:
Alfredo Sumaran 2016-05-18 20:23:00 -05:00 committed by Jacob Schatz
parent bc38bfada7
commit 77ca4a675a
1 changed files with 5 additions and 5 deletions

View File

@ -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