diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-06-23 05:19:07 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-06-23 05:19:07 +0000 |
commit | d8a202471586677cf1863de390389058b1f0a0c0 (patch) | |
tree | f6073dbcea4bcfd82ace98f92b2a9bb6a73a2e82 /app/models/query.rb | |
parent | ce1c65225037622c10568b3e6955cecce7e80fd9 (diff) | |
download | redmine-d8a202471586677cf1863de390389058b1f0a0c0.tar.gz redmine-d8a202471586677cf1863de390389058b1f0a0c0.zip |
Dangerous query method deprecation warnings (#23630).
git-svn-id: http://svn.redmine.org/redmine/trunk@17411 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/query.rb')
-rw-r--r-- | app/models/query.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/query.rb b/app/models/query.rb index 53a245a8d..115e1bb7c 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -780,14 +780,16 @@ class Query < ActiveRecord::Base end def sort_clause - sort_criteria.sort_clause(sortable_columns) + if clause = sort_criteria.sort_clause(sortable_columns) + clause.map {|c| Arel.sql c} + end end # Returns the SQL sort order that should be prepended for grouping def group_by_sort_order if column = group_by_column order = (sort_criteria.order_for(column.name) || column.default_order || 'asc').try(:upcase) - Array(column.sortable).map {|s| "#{s} #{order}"} + Array(column.sortable).map {|s| Arel.sql("#{s} #{order}")} end end |