fixes #2531: Topic merge should update updater_id
This commit is contained in:
@@ -149,8 +149,8 @@ class ForumTopic < ActiveRecord::Base
|
|||||||
|
|
||||||
def merge(topic)
|
def merge(topic)
|
||||||
ForumPost.where(:id => self.posts.map(&:id)).update_all(:topic_id => topic.id)
|
ForumPost.where(:id => self.posts.map(&:id)).update_all(:topic_id => topic.id)
|
||||||
topic.update_attribute(:response_count, topic.response_count + self.posts.length)
|
topic.update_attributes(:response_count => topic.response_count + self.posts.length, :updater_id => CurrentUser.id)
|
||||||
self.update_columns(:response_count => 0, :is_deleted => true)
|
self.update_columns(:response_count => 0, :is_deleted => true, :updater_id => CurrentUser.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete!
|
def delete!
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class ForumPostTest < ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
dmail = Dmail.last
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user