diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-03-07 21:35:15 +0900 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-03 02:11:50 +0900 |
commit | fa64da65e7205b101569a3e515a0a65ae2d679c9 (patch) | |
tree | 3ba353af44350ce486b3e8a3c9442220cb964006 | |
parent | e3fd8caf94c4d5ca0b6bc086d43effc2fb7c5792 (diff) | |
download | gitlab-ce-fa64da65e7205b101569a3e515a0a65ae2d679c9.tar.gz |
Use 'case/when/end'
-rw-r--r-- | app/finders/pipelines_finder.rb | 12 |
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 |