From: Jean-Philippe Lang Date: Mon, 16 May 2016 07:08:31 +0000 (+0000) Subject: Always return an array. X-Git-Tag: 3.3.0~56 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ada650ce7f4ba7e688b5f4932288d71a093b2661;p=redmine.git Always return an array. git-svn-id: http://svn.redmine.org/redmine/trunk@15417 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- 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