##// END OF EJS Templates
Fixes spent time column sort for postgresql....
Jean-Philippe Lang -
r7957:68149f8c73cf
parent child
Show More
@@ -367,7 +367,7 class Query < ActiveRecord::Base
367 index = (index ? index + 1 : -1)
367 index = (index ? index + 1 : -1)
368 # insert the column after estimated_hours or at the end
368 # insert the column after estimated_hours or at the end
369 @available_columns.insert index, QueryColumn.new(:spent_hours,
369 @available_columns.insert index, QueryColumn.new(:spent_hours,
370 :sortable => "(SELECT SUM(hours) FROM #{TimeEntry.table_name} WHERE #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id)",
370 :sortable => "(SELECT COALESCE(SUM(hours), 0) FROM #{TimeEntry.table_name} WHERE #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id)",
371 :default_order => 'desc',
371 :default_order => 'desc',
372 :caption => :label_spent_time
372 :caption => :label_spent_time
373 )
373 )
General Comments 0
You need to be logged in to leave comments. Login now