From 01fe0dcfd968c67949fbe63f99a77a88194491ef Mon Sep 17 00:00:00 2001 From: Jens Kraemer Date: Mon, 12 Apr 2021 14:11:44 +0800 Subject: [PATCH 5/5] sanitize_sql_for_conditions is now public --- app/models/query.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/query.rb b/app/models/query.rb index 1a30b1370..0d7ef3f5b 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -1430,9 +1430,10 @@ class Query < ActiveRecord::Base suffix = '%' if options[:starts_with] prefix = suffix = '%' if prefix.nil? && suffix.nil? value = queried_class.sanitize_sql_like value - queried_class.send( - :sanitize_sql_for_conditions, - [Redmine::Database.like(db_field, '?', :match => options[:match]), "#{prefix}#{value}#{suffix}"]) + queried_class.sanitize_sql_for_conditions([ + Redmine::Database.like(db_field, '?', :match => options[:match]), + "#{prefix}#{value}#{suffix}" + ]) end # Adds a filter for the given custom field -- 2.20.1