From 1bfe6715c645d9aaaa3c7b0db216d4724be6ff64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=A4fer?= Date: Fri, 8 Jul 2011 23:20:17 +0200 Subject: [PATCH] Put empty start_dates in the future too. #499 --- app/models/query.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/query.rb b/app/models/query.rb index da1f9fa8..052990ba 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -126,8 +126,8 @@ class Query < ActiveRecord::Base QueryColumn.new(:updated_on, :sortable => "#{Issue.table_name}.updated_on", :default_order => 'desc'), QueryColumn.new(:category, :sortable => "#{IssueCategory.table_name}.name", :groupable => true), QueryColumn.new(:fixed_version, :sortable => ["#{Version.table_name}.effective_date", "#{Version.table_name}.name"], :default_order => 'desc', :groupable => true), - QueryColumn.new(:start_date, :sortable => "#{Issue.table_name}.start_date"), - # Put empty due_dates in the far future rather than in the far past + # Put empty start_dates and due_dates in the far future rather than in the far past + QueryColumn.new(:start_date, :sortable => ["CASE WHEN #{Issue.table_name}.start_date IS NULL THEN 1 ELSE 0 END", "#{Issue.table_name}.start_date"]), QueryColumn.new(:due_date, :sortable => ["CASE WHEN #{Issue.table_name}.due_date IS NULL THEN 1 ELSE 0 END", "#{Issue.table_name}.due_date"]), QueryColumn.new(:estimated_hours, :sortable => "#{Issue.table_name}.estimated_hours"), QueryColumn.new(:done_ratio, :sortable => "#{Issue.table_name}.done_ratio", :groupable => true),