Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-03-07 15:35:15 +0300
committerShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-05-02 20:11:50 +0300
commitfa64da65e7205b101569a3e515a0a65ae2d679c9 (patch)
tree3ba353af44350ce486b3e8a3c9442220cb964006 /app/finders
parente3fd8caf94c4d5ca0b6bc086d43effc2fb7c5792 (diff)
Use 'case/when/end'
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/pipelines_finder.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/app/finders/pipelines_finder.rb b/app/finders/pipelines_finder.rb
index 93f1ab9598f..46588cf3c16 100644
--- a/app/finders/pipelines_finder.rb
+++ b/app/finders/pipelines_finder.rb
@@ -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