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 /lib/redmine/field_format.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 'lib/redmine/field_format.rb')
-rw-r--r-- | lib/redmine/field_format.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/redmine/field_format.rb b/lib/redmine/field_format.rb index bcf6ccc3d..c4960c0f7 100644 --- a/lib/redmine/field_format.rb +++ b/lib/redmine/field_format.rb @@ -323,7 +323,7 @@ module Redmine # Returns nil if the custom field can not be used for sorting. def order_statement(custom_field) # COALESCE is here to make sure that blank and NULL values are sorted equally - "COALESCE(#{join_alias custom_field}.value, '')" + Arel.sql "COALESCE(#{join_alias custom_field}.value, '')" end # Returns a GROUP BY clause that can used to group by custom value @@ -461,7 +461,7 @@ module Redmine # Make the database cast values into numeric # Postgresql will raise an error if a value can not be casted! # CustomValue validations should ensure that it doesn't occur - "CAST(CASE #{join_alias custom_field}.value WHEN '' THEN '0' ELSE #{join_alias custom_field}.value END AS decimal(30,3))" + Arel.sql "CAST(CASE #{join_alias custom_field}.value WHEN '' THEN '0' ELSE #{join_alias custom_field}.value END AS decimal(30,3))" end # Returns totals for the given scope @@ -747,7 +747,7 @@ module Redmine end def group_statement(custom_field) - "COALESCE(#{join_alias custom_field}.value, '')" + Arel.sql "COALESCE(#{join_alias custom_field}.value, '')" end def join_for_order_statement(custom_field) |