This commit is contained in:
Nicolas Bally 2021-06-11 16:29:07 +02:00
parent 6b290a38fa
commit 917fddae4e

View File

@ -45,7 +45,10 @@ class ForumTopic < ActiveRecord::Base
end end
ForumUser.where(:follow_new_topics => true).each do |forum_user| ForumUser.where(:follow_new_topics => true).each do |forum_user|
folowed_topic = forum_user.followed_topics.find_or_initialize_by_forum_topic_id(topic.id) if folowed_topic = FolowedTopic.where(:forum_topic_id => topic.id).first
else
folowed_topic = FolowedTopic.create(:forum_topic_id => topic.id)
end
folowed_topic.save folowed_topic.save