forked from e621ng/e621ng
fixes #2531: Topic merge should update updater_id
This commit is contained in:
parent
cae88fdac2
commit
34aa777aad
@ -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!
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user