summaryrefslogtreecommitdiffstats
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2021-10-05 19:54:31 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2021-10-05 19:54:31 +0000
commit506fc9d74cdb67af2eaea27662420ec07e32b2f3 (patch)
tree523ac0beb65ba62944c99924397c45669d0f23d6 /app/models/issue.rb
parent04e27aa1616f78381fab69b2b72ba5874e4cc557 (diff)
downloadredmine-506fc9d74cdb67af2eaea27662420ec07e32b2f3.tar.gz
redmine-506fc9d74cdb67af2eaea27662420ec07e32b2f3.zip
Tokenize search parameter in order to allow multiple search terms in:
* the "contains" operator of text filters * in issue autocomplete Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@21238 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 70b408a21..55962f0fe 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -100,9 +100,8 @@ class Issue < ActiveRecord::Base
ids.any? ? where(:assigned_to_id => ids) : none
end)
scope :like, (lambda do |q|
- q = q.to_s
if q.present?
- where("LOWER(#{table_name}.subject) LIKE LOWER(?)", "%#{sanitize_sql_like q}%")
+ where(*::Query.tokenized_like_conditions("#{table_name}.subject", q))
end
end)