models: replace raw LIKE queries with where_like.

This commit is contained in:
evazion
2020-01-22 13:21:31 -06:00
parent 9d71c77524
commit 22cb0ea322
10 changed files with 28 additions and 29 deletions

View File

@@ -51,7 +51,7 @@ class TagBatchChangeJob < ApplicationJob
query = normalized_antecedent
adds = normalized_consequent
arel = query.inject(User.none) do |scope, x|
scope.or(User.where("blacklisted_tags like ?", "%" + x.to_escaped_for_sql_like + "%"))
scope.or(User.where_like(:blacklisted_tags, "*#{x}*"))
end
arel.find_each do |user|