2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00
discourse/lib/tasks/user_actions.rake

16 lines
594 B
Ruby
Raw Normal View History

2013-02-05 14:16:51 -05:00
desc "rebuild the user_actions table"
2013-02-25 19:42:20 +03:00
task "user_actions:rebuild" => :environment do
2013-02-05 14:16:51 -05:00
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
2013-02-05 14:16:51 -05:00
end