Commit fa64da65 authored by Shinya Maeda's avatar Shinya Maeda

Use 'case/when/end'

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