This commit is contained in:
albert
2013-03-12 13:21:46 -04:00
parent 698c08f058
commit 71fe9def4f
3 changed files with 7 additions and 7 deletions

View File

@@ -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?

View File

@@ -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?

View File

@@ -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}")