rosa-build/lib/tasks/activity_feeds.rake

13 lines
431 B
Ruby
Raw Normal View History

2012-11-14 18:10:03 +00:00
namespace :activity_feeds do
desc 'Remove outdated activity feeds'
2014-01-21 04:51:49 +00:00
task clear: :environment do
2012-11-14 18:10:03 +00:00
say "Removing outdated Activity Feed"
User.all.each do |user|
outdated = ActivityFeed.outdated
say "User #{user.uname} has #{outdated.count} outdated ActivityFeed."
user.activity_feeds.outdated.destroy_all if outdated.count > 0
end
say "Outdated activity feeds was successfully removed."
end
end