FIX: If a category of a topic changed, watching/tracking didn't kick in

This commit is contained in:
Robin Ward
2015-03-04 13:39:17 -05:00
parent 93b43c5237
commit c4fa75918b
2 changed files with 15 additions and 0 deletions

View File

@@ -474,6 +474,8 @@ class Topic < ActiveRecord::Base
Category.where(id: new_category.id).update_all("topic_count = topic_count + 1")
CategoryFeaturedTopic.feature_topics_for(old_category) unless @import_mode
CategoryFeaturedTopic.feature_topics_for(new_category) unless @import_mode || old_category.id == new_category.id
CategoryUser.auto_watch_new_topic(self)
CategoryUser.auto_track_new_topic(self)
end
true