diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-09-29 15:28:26 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-09-29 15:28:26 +0000 |
commit | 81782f2408b1a2421c8778deacb97ac61c963216 (patch) | |
tree | dd0a87a08e6c7dc2e3a5507e6155ed5155771dfd /app | |
parent | 99662fa18ee5c080b6b4fee9c85522144a89c59d (diff) | |
download | redmine-81782f2408b1a2421c8778deacb97ac61c963216.tar.gz redmine-81782f2408b1a2421c8778deacb97ac61c963216.zip |
Call sort for array with more than one element only.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10519 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/query.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/query.rb b/app/models/query.rb index a3c66f90d..357bad5a8 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -70,8 +70,8 @@ class QueryCustomFieldColumn < QueryColumn end def value(issue) - cv = issue.custom_values.select {|v| v.custom_field_id == @cf.id}.collect {|v| @cf.cast_value(v.value)}.sort {|a,b| a.to_s <=> b.to_s} - cv.size > 1 ? cv : cv.first + cv = issue.custom_values.select {|v| v.custom_field_id == @cf.id}.collect {|v| @cf.cast_value(v.value)} + cv.size > 1 ? cv.sort {|a,b| a.to_s <=> b.to_s} : cv.first end def css_classes |