fixes #2531: Topic merge should update updater_id

This commit is contained in:
r888888888 2015-10-26 12:55:42 -07:00
parent cae88fdac2
commit 34aa777aad
2 changed files with 3 additions and 3 deletions

View File

@ -149,8 +149,8 @@ class ForumTopic < ActiveRecord::Base
def merge(topic)
ForumPost.where(:id => self.posts.map(&:id)).update_all(:topic_id => topic.id)
topic.update_attribute(:response_count, topic.response_count + self.posts.length)
self.update_columns(:response_count => 0, :is_deleted => true)
topic.update_attributes(:response_count => topic.response_count + self.posts.length, :updater_id => CurrentUser.id)
self.update_columns(:response_count => 0, :is_deleted => true, :updater_id => CurrentUser.id)
end
def delete!

View File

@ -26,7 +26,7 @@ class ForumPostTest < ActiveSupport::TestCase
end
dmail = Dmail.last
assert_equal("You were mentioned in the forum topic \"#{@topic.title}\":#{Danbooru.config.hostname}/forum_topics/#{@topic.id}?page=1\n\n<hr>\n\nHey @#{@user2.name} check this out!", dmail.body)
assert_equal("You were mentioned in the forum topic \"#{@topic.title}\":#{Danbooru.config.hostname}/forum_topics/#{@topic.id}?page=1\n\n---\n\nHey @#{@user2.name} check this out!", dmail.body)
end
end