FEATURE: Event on topic merge (#6057)

This commit is contained in:
Jordan Seanor
2018-07-09 21:28:57 -04:00
committed by Guo Xiang Tan
parent 6cc860be09
commit 10bc69a62f
2 changed files with 8 additions and 0 deletions

View File

@@ -913,6 +913,7 @@ class Topic < ActiveRecord::Base
if opts[:destination_topic_id]
post_mover.to_topic opts[:destination_topic_id]
DiscourseEvent.trigger(:topic_merged, post_mover.original_topic, post_mover.destination_topic)
elsif opts[:title]
post_mover.to_new_topic(opts[:title], opts[:category_id], opts[:tags])
end