discourse/lib/tasks/user_actions.rake
Sam 2f6a4cc6de remove UserActionObserver, replace with after_save and service
interestingly there was some left over dead code from when stars
existed in the topic_users table
2016-12-22 16:46:53 +11:00

16 lines
594 B
Ruby

desc "rebuild the user_actions table"
task "user_actions:rebuild" => :environment do
MessageBus.off
UserAction.delete_all
PostAction.all.each{|i| UserActionCreator.log_post_action(i)}
Topic.all.each {|i| UserActionCreator.log_topic(i)}
Post.all.each {|i| UserActionCreator.log_post(i)}
Notification.all.each do |notification|
UserActionCreator.log_notification(notification.post,
notification.user,
notification.notification_type,
notification.user)
end
end