diff --git a/app/logical/tag_alias_request.rb b/app/logical/tag_alias_request.rb index d97541bae..169bc9d82 100644 --- a/app/logical/tag_alias_request.rb +++ b/app/logical/tag_alias_request.rb @@ -4,8 +4,8 @@ class TagAliasRequest attr_reader :antecedent_name, :consequent_name, :reason, :tag_alias, :forum_topic def initialize(antecedent_name, consequent_name, reason) - @antecedent_name = antecedent_name - @consequent_name = consequent_name + @antecedent_name = antecedent_name.tr(" ", "_") + @consequent_name = consequent_name.tr(" ", "_") @reason = reason end @@ -27,7 +27,7 @@ class TagAliasRequest @forum_topic = ForumTopic.create( :title => "Tag alias: #{antecedent_name} -> #{consequent_name}", :original_post_attributes => { - :body => reason + "\n\n\"Link to alias\":/tag_aliases?search[id]=#{tag_alias.id}" + :body => reason + "\n\ncreate alias #{antecedent_name} -> #{consequent_name}\n\n\"Link to alias\":/tag_aliases?search[id]=#{tag_alias.id}\n\nLink to wiki: [[#{antecedent_name}]] -> [[#{consequent_name}]]" } ) if @forum_topic.errors.any? diff --git a/app/logical/tag_implication_request.rb b/app/logical/tag_implication_request.rb index bd148efc0..621339117 100644 --- a/app/logical/tag_implication_request.rb +++ b/app/logical/tag_implication_request.rb @@ -4,8 +4,8 @@ class TagImplicationRequest attr_reader :antecedent_name, :consequent_name, :reason, :tag_implication, :forum_topic def initialize(antecedent_name, consequent_name, reason) - @antecedent_name = antecedent_name - @consequent_name = consequent_name + @antecedent_name = antecedent_name.tr(" ", "_") + @consequent_name = consequent_name.tr(" ", "_") @reason = reason end @@ -27,7 +27,7 @@ class TagImplicationRequest @forum_topic = ForumTopic.create( :title => "Tag implication: #{antecedent_name} -> #{consequent_name}", :original_post_attributes => { - :body => reason + "\n\n\"Link to implication\":/tag_implications?search[id]=#{tag_implication.id}" + :body => reason + "\n\ncreate implication #{antecedent_name} -> #{consequent_name}\n\n\"Link to implication\":/tag_implications?search[id]=#{tag_implication.id}\n\nLink to wiki: [[#{antecedent_name}]] -> [[#{consequent_name}]]" } ) if @forum_topic.errors.any? diff --git a/app/models/tag_alias.rb b/app/models/tag_alias.rb index 0101b25ab..09cdccbdc 100644 --- a/app/models/tag_alias.rb +++ b/app/models/tag_alias.rb @@ -52,8 +52,8 @@ class TagAlias < ActiveRecord::Base def process! update_column(:status, "processing") - update_posts clear_all_cache + update_posts update_column(:status, "active") rescue Exception => e update_column(:status, "error: #{e}")