diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-05-16 07:08:31 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-05-16 07:08:31 +0000 |
commit | ada650ce7f4ba7e688b5f4932288d71a093b2661 (patch) | |
tree | 0d17590ddcd9ddec3fef980d41ddb609bc78076f /app/models | |
parent | 14beafcc24af288cabea00637c11e4df92b8d959 (diff) | |
download | redmine-ada650ce7f4ba7e688b5f4932288d71a093b2661.tar.gz redmine-ada650ce7f4ba7e688b5f4932288d71a093b2661.zip |
Always return an array.
git-svn-id: http://svn.redmine.org/redmine/trunk@15417 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/query.rb | 6 |
1 files 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 |