bug fix for saved search update on tag batch changes
This commit is contained in:
@@ -22,10 +22,10 @@ module Moderator
|
||||
|
||||
tags = Tag.scan_tags(antecedent, :strip_metatags => true)
|
||||
conds = tags.map {|x| "tag_query like ?"}.join(" AND ")
|
||||
conds = [conds, *tags.map {|x| "%#{x}%"}]
|
||||
conds = [conds, *tags.map {|x| "%#{x.to_escaped_for_sql_like}%"}]
|
||||
if SavedSearch.enabled?
|
||||
SavedSearch.where(*conds).find_each do |ss|
|
||||
ss.tag_query = (ss.tag_query_array - tags + antecedent).uniq.join(" ")
|
||||
ss.tag_query = (ss.tag_query_array - tags + [consequent]).uniq.join(" ")
|
||||
ss.save
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user