From 6b62d75c50148c8d7fec044adcf3a3ff099b3501 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Tue, 28 Apr 2020 16:27:33 +1000 Subject: [PATCH] FIX: remove unsuppored rake task rebuilding user_actions is not something that should be done. Plugins such as solved and assigned extend it, there are tons of little rules that were not captured in `user_actions:rebuild` --- lib/tasks/user_actions.rake | 41 ------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 lib/tasks/user_actions.rake diff --git a/lib/tasks/user_actions.rake b/lib/tasks/user_actions.rake deleted file mode 100644 index 2d2631d1f3..0000000000 --- a/lib/tasks/user_actions.rake +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -desc "rebuild the user_actions table" -task "user_actions:rebuild" => :environment do - MessageBus.off - UserAction.delete_all - PostAction.all.each do |i| - if i.deleted_at.nil? - UserActionManager.post_action_created(i) - else - UserActionManager.post_action_destroyed(i) - end - end - Topic.all.each { |i| UserActionManager.log_topic(i) } - Post.all.each do |i| - if i.deleted_at.nil? - UserActionManager.post_created(i) - else - UserActionManager.post_destroyed(i) - end - end - Notification.all.each do |notification| - - if notification.post.deleted_at.nil? - UserActionManager.notification_created( - notification.post, - notification.user, - notification.notification_type, - notification.user - ) - else - UserActionManager.notification_destroyed( - notification.post, - notification.user, - notification.notification_type, - notification.user - ) - end - - end -end