summaryrefslogtreecommitdiffstats
path: root/app/models/query.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-10-01 11:39:34 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-10-01 11:39:34 +0000
commit514cdacc87e68526488aaf376ec58c3edfb60492 (patch)
tree2c0240d5c11fd775817bc99446c1c6ac4ef56a90 /app/models/query.rb
parent96b4ac12cbc9a89a6e29d50764ed668102c3c93a (diff)
downloadredmine-514cdacc87e68526488aaf376ec58c3edfb60492.tar.gz
redmine-514cdacc87e68526488aaf376ec58c3edfb60492.zip
Custom query columns: checkboxes replaced by two selects that let the user specify columns order.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@784 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/query.rb')
-rw-r--r--app/models/query.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/query.rb b/app/models/query.rb
index 400572eb2..30441d260 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -211,7 +211,8 @@ class Query < ActiveRecord::Base
if has_default_columns?
available_columns.select {|c| c.default? }
else
- available_columns.select {|c| column_names.include?(c.name) }
+ # preserve the column_names order
+ column_names.collect {|name| available_columns.find {|col| col.name == name}}.compact
end
end