From ada650ce7f4ba7e688b5f4932288d71a093b2661 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 16 May 2016 07:08:31 +0000 Subject: [PATCH] Always return an array. git-svn-id: http://svn.redmine.org/redmine/trunk@15417 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/query.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/models/query.rb b/app/models/query.rb index a9d24ad30..cc84b01ed 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -543,11 +543,9 @@ class Query < ActiveRecord::Base # Returns the SQL sort order that should be prepended for grouping def group_by_sort_order - if grouped? && (column = group_by_column) + if column = group_by_column order = (sort_criteria_order_for(column.name) || column.default_order).try(:upcase) - column.sortable.is_a?(Array) ? - column.sortable.collect {|s| "#{s} #{order}"} : - "#{column.sortable} #{order}" + Array(column.sortable).map {|s| "#{s} #{order}"} end end -- 2.39.5