BURs: don't add [APPROVED] / [REJECTED] tags to titles.

This commit is contained in:
evazion
2020-03-10 21:02:12 -05:00
parent 0e7632ed8a
commit be585060f4
3 changed files with 8 additions and 25 deletions

View File

@@ -1,18 +1,16 @@
class ForumUpdater
attr_reader :forum_topic, :forum_post, :expected_title
attr_reader :forum_topic, :forum_post
def initialize(forum_topic, options = {})
@forum_topic = forum_topic
@forum_post = options[:forum_post]
@expected_title = options[:expected_title]
end
def update(message, title_tag = nil)
def update(message)
return if forum_topic.nil?
CurrentUser.scoped(User.system) do
create_response(message)
update_title(title_tag) if title_tag
if forum_post
update_post(message)
@@ -24,12 +22,6 @@ class ForumUpdater
forum_topic.posts.create(body: body, skip_mention_notifications: true, creator: User.system)
end
def update_title(title_tag)
if forum_topic.title == expected_title
forum_topic.update(:title => "[#{title_tag}] #{forum_topic.title}")
end
end
def update_post(body)
forum_post.update(body: "#{forum_post.body}\n\nEDIT: #{body}", skip_mention_notifications: true)
end