Merge pull request #3375 from evazion/feat-3372

Fix #3374: List approver in BUR approval messages
This commit is contained in:
Albert Yi
2017-11-16 11:02:18 -08:00
committed by GitHub
13 changed files with 78 additions and 45 deletions

View File

@@ -21,9 +21,10 @@ class ForumUpdater
end
def create_response(body)
forum_topic.posts.create(
:body => body
)
forum_topic.posts.create({
:body => body,
:skip_mention_notifications => true
}, :without_protection => true)
end
def update_title(title_tag)
@@ -33,6 +34,6 @@ class ForumUpdater
end
def update_post(body)
forum_post.update(:body => "#{forum_post.body}\n\n#{body}")
forum_post.update({:body => "#{forum_post.body}\n\nEDIT: #{body}", :skip_mention_notifications => true }, :without_protection => true)
end
end

View File

@@ -9,7 +9,7 @@ module Mentionable
@mentionable_options = options
message_field = mentionable_option(:message_field)
after_save :queue_mention_messages, if: :"#{message_field}_changed?"
after_save :queue_mention_messages
end
def mentionable_option(key)
@@ -19,6 +19,9 @@ module Mentionable
def queue_mention_messages
message_field = self.class.mentionable_option(:message_field)
return if !send("#{message_field}_changed?")
return if self.skip_mention_notifications
text = send(message_field)
text_was = send("#{message_field}_was")

View File

@@ -31,7 +31,9 @@ class TagAliasRequest
@forum_topic = build_forum_topic(@tag_alias.id)
@forum_topic.save
@tag_alias.update_attributes(forum_topic_id: @forum_topic.id, forum_post_id: @forum_topic.posts.first.id)
@tag_alias.forum_topic_id = @forum_topic.id
@tag_alias.forum_post_id = @forum_topic.posts.first.id
@tag_alias.save
end
end

View File

@@ -31,7 +31,9 @@ class TagImplicationRequest
@forum_topic = build_forum_topic(@tag_implication.id)
@forum_topic.save
@tag_implication.update_attributes(:forum_topic_id => @forum_topic.id, :forum_post_id => @forum_topic.posts.first.id)
@tag_implication.forum_topic_id = @forum_topic.id
@tag_implication.forum_post_id = @forum_topic.posts.first.id
@tag_implication.save
end
end