discourse/lib/tasks/user_actions.rake

14 lines
384 B
Ruby
Raw Normal View History

2013-02-05 13:16:51 -06:00
desc "rebuild the user_actions table"
2013-02-25 10:42:20 -06:00
task "user_actions:rebuild" => :environment do
o = UserActionObserver.send :new
2013-02-05 13:16:51 -06:00
MessageBus.off
UserAction.delete_all
PostAction.all.each{|i| o.after_save(i)}
Topic.all.each {|i| o.after_save(i)}
Post.all.each {|i| o.after_save(i)}
Notification.all.each {|i| o.after_save(i)}
2013-02-25 10:42:20 -06:00
# not really needed but who knows
2013-02-05 13:16:51 -06:00
MessageBus.on
end