diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-02-05 17:28:02 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-02-05 17:28:02 +0000 |
commit | 54ff294da164d9c8a0659610019f801ae4788068 (patch) | |
tree | 1a844a450847536b2303058332ef23a321f66ad3 /app/models | |
parent | 80a60247f527825aa5e02e19bcaec4bd864fce2a (diff) | |
download | redmine-54ff294da164d9c8a0659610019f801ae4788068.tar.gz redmine-54ff294da164d9c8a0659610019f801ae4788068.zip |
More appropriate default sort order on sortable columns.
Sortable column added on issue subject (#580).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1121 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/query.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/models/query.rb b/app/models/query.rb index 7127a464f..a4103c08a 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -16,12 +16,13 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class QueryColumn - attr_accessor :name, :sortable + attr_accessor :name, :sortable, :default_order include GLoc def initialize(name, options={}) self.name = name self.sortable = options[:sortable] + self.default_order = options[:default_order] end def caption @@ -94,18 +95,18 @@ class Query < ActiveRecord::Base @@available_columns = [ QueryColumn.new(:tracker, :sortable => "#{Tracker.table_name}.position"), QueryColumn.new(:status, :sortable => "#{IssueStatus.table_name}.position"), - QueryColumn.new(:priority, :sortable => "#{Enumeration.table_name}.position"), - QueryColumn.new(:subject), + QueryColumn.new(:priority, :sortable => "#{Enumeration.table_name}.position", :default_order => 'desc'), + QueryColumn.new(:subject, :sortable => "#{Issue.table_name}.subject"), QueryColumn.new(:author), QueryColumn.new(:assigned_to, :sortable => "#{User.table_name}.lastname"), - QueryColumn.new(:updated_on, :sortable => "#{Issue.table_name}.updated_on"), + QueryColumn.new(:updated_on, :sortable => "#{Issue.table_name}.updated_on", :default_order => 'desc'), QueryColumn.new(:category, :sortable => "#{IssueCategory.table_name}.name"), QueryColumn.new(:fixed_version), QueryColumn.new(:start_date, :sortable => "#{Issue.table_name}.start_date"), QueryColumn.new(:due_date, :sortable => "#{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"), - QueryColumn.new(:created_on, :sortable => "#{Issue.table_name}.created_on"), + QueryColumn.new(:created_on, :sortable => "#{Issue.table_name}.created_on", :default_order => 'desc'), ] cattr_reader :available_columns |