]> source.dussan.org Git - redmine.git/commitdiff
Always return an array.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 16 May 2016 07:08:31 +0000 (07:08 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 16 May 2016 07:08:31 +0000 (07:08 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@15417 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/query.rb

index a9d24ad3070e26dc991274034ced6e912433767b..cc84b01ed32229cb5ad22717be24bcfb2cbf42fe 100644 (file)
@@ -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