summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-03-01 15:58:06 +0900
committerShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-05-03 02:11:50 +0900
commitfd302061f915f535b2dd419d5a76efb76ab534be (patch)
treec982fbf7d0a26336b63c395978c1cad9d978700c /app/finders
parentdf834306c1794ed72d6d655c7941dee28f7e85c7 (diff)
downloadgitlab-ce-fd302061f915f535b2dd419d5a76efb76ab534be.tar.gz
Fix rubocop offences and rspec failures
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/pipelines_finder.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/finders/pipelines_finder.rb b/app/finders/pipelines_finder.rb
index ff16d7305ad..4a44a469a48 100644
--- a/app/finders/pipelines_finder.rb
+++ b/app/finders/pipelines_finder.rb
@@ -101,8 +101,8 @@ class PipelinesFinder
def order_and_sort(items)
if params[:order_by].present? && params[:sort].present? &&
- items.column_names.include?(params[:order_by]) &&
- (params[:sort].downcase == 'asc' || params[:sort].downcase == 'desc')
+ items.column_names.include?(params[:order_by]) &&
+ (params[:sort].casecmp('ASC') || params[:sort].casecmp('DESC'))
items.order("#{params[:order_by]} #{params[:sort]}")
else
items.order(id: :desc)