fixes null last ordering for backlogs on postgresql

pull/6827/head
Jens Ulferts 12 years ago
parent 613f4f9062
commit 6105ab1aff
  1. 4
      app/models/sprint.rb

@ -7,13 +7,13 @@ class Sprint < Version
named_scope :open_sprints, lambda { |project|
{
:order => 'COALESCE(start_date, 4000-12-30) ASC, COALESCE(effective_date, 4000-12-30) ASC',
:order => "COALESCE(start_date, CAST('4000-12-30' as date)) ASC, COALESCE(effective_date, CAST('4000-12-30' as date)) ASC",
:conditions => [ "versions.status = 'open' and versions.project_id = ?", project.id ]
}
}
#null last ordering
named_scope :order_by_date, :order => 'COALESCE(start_date, 4000-12-30) ASC, COALESCE(effective_date, 4000-12-30) ASC'
named_scope :order_by_date, :order => "COALESCE(start_date, CAST('4000-12-30' as date)) ASC, COALESCE(effective_date, CAST('4000-12-30' as date)) ASC"
named_scope :order_by_name, :order => "#{Version.table_name}.name ASC"
named_scope :apply_to, lambda { |project| {:include => :project,

Loading…
Cancel
Save