summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-05-11 04:04:51 +0000
committerGo MAEDA <maeda@farend.jp>2023-05-11 04:04:51 +0000
commite8d8d6b7f16fba87210c77c18401362d8def60dc (patch)
tree153e7ccaecd308ad1bd18eb138b28062f65b720e /app/models
parent3cd73c205ea5195491ff3503da400c9b9e12587a (diff)
downloadredmine-e8d8d6b7f16fba87210c77c18401362d8def60dc.tar.gz
redmine-e8d8d6b7f16fba87210c77c18401362d8def60dc.zip
Fix PostgreSQL error caused by comparing text with integer values (#38527).
git-svn-id: https://svn.redmine.org/redmine/trunk@22242 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r--app/models/query.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/query.rb b/app/models/query.rb
index f4bbfb5cd..117f6e226 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -1456,11 +1456,11 @@ class Query < ActiveRecord::Base
" AND #{JournalDetail.table_name}.property = 'attr'" +
" AND #{JournalDetail.table_name}.prop_key = '#{db_field}'" +
" AND " +
- queried_class.send(:sanitize_sql_for_conditions, ["#{JournalDetail.table_name}.old_value IN (?)", value]) +
+ queried_class.send(:sanitize_sql_for_conditions, ["#{JournalDetail.table_name}.old_value IN (?)", value.map(&:to_s)]) +
")"
if %w[ev !ev].include?(operator)
subquery <<
- " OR " + queried_class.send(:sanitize_sql_for_conditions, ["#{db_table}.#{db_field} IN (?)", value])
+ " OR " + queried_class.send(:sanitize_sql_for_conditions, ["#{db_table}.#{db_field} IN (?)", value.map(&:to_s)])
end
sql = "#{neg} EXISTS (#{subquery})"
else