fixes #1683
This commit is contained in:
@@ -105,10 +105,10 @@ class TagImplication < ActiveRecord::Base
|
|||||||
|
|
||||||
module ClassMethods
|
module ClassMethods
|
||||||
def update_posts_for_destroy(creator_id, creator_ip_addr, antecedent_name, consequent_name)
|
def update_posts_for_destroy(creator_id, creator_ip_addr, antecedent_name, consequent_name)
|
||||||
Post.tag_match("#{antecedent_name} #{consequent_name} status:any").find_each do |post|
|
CurrentUser.scoped(User.find(creator_id), creator_ip_addr) do
|
||||||
escaped_tag_name = Regexp.escape(consequent_name)
|
Post.tag_match("#{antecedent_name} #{consequent_name} status:any").find_each do |post|
|
||||||
fixed_tags = post.tag_string.sub(/(?:\A| )#{escaped_tag_name}(?:\Z| )/, " ").strip
|
escaped_tag_name = Regexp.escape(consequent_name)
|
||||||
CurrentUser.scoped(User.find(creator_id), creator_ip_addr) do
|
fixed_tags = post.tag_string.sub(/(?:\A| )#{escaped_tag_name}(?:\Z| )/, " ").strip
|
||||||
post.update_attributes(
|
post.update_attributes(
|
||||||
:tag_string => fixed_tags
|
:tag_string => fixed_tags
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user