Sort issues by scheduled versions first then unscheduled versions.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10151 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -186,9 +186,11 @@ class Version < ActiveRecord::Base
|
||||
|
||||
def self.fields_for_order_statement(table=nil)
|
||||
table ||= table_name
|
||||
%w(effective_date name).map {|field| "#{table}.#{field}"}
|
||||
["(CASE WHEN #{table}.effective_date IS NULL THEN 1 ELSE 0 END)", "#{table}.effective_date", "#{table}.name", "#{table}.id"]
|
||||
end
|
||||
|
||||
scope :sorted, order(fields_for_order_statement)
|
||||
|
||||
# Returns the sharings that +user+ can set the version to
|
||||
def allowed_sharings(user = User.current)
|
||||
VERSION_SHARINGS.select do |s|
|
||||
|
||||
Reference in New Issue
Block a user