Commit fa64da65 authored by Shinya Maeda's avatar Shinya Maeda

Use 'case/when/end'

parent e3fd8caf
......@@ -88,13 +88,11 @@ class PipelinesFinder
end
def by_yaml_errors(items)
flg = Gitlab::Utils.to_boolean(params[:yaml_errors])
if !flg.nil?
if flg
items.where("yaml_errors IS NOT NULL")
else
items.where("yaml_errors IS NULL")
end
case Gitlab::Utils.to_boolean(params[:yaml_errors])
when true
items.where("yaml_errors IS NOT NULL")
when false
items.where("yaml_errors IS NULL")
else
items
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