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
This commit is contained in:
Jean-Philippe Lang
2007-10-01 11:39:34 +00:00
parent 96b4ac12cb
commit 514cdacc87
8 changed files with 86 additions and 10 deletions
+2 -1
View File
@@ -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