Commit 77ca4a67 authored by Alfredo Sumaran's avatar Alfredo Sumaran Committed by Jacob Schatz

Make conditional a guard clause

parent bc38bfad
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment