rosa-build/lib/tasks/activity_feeds.rake

13 lines
434 B
Ruby
Raw Normal View History

2012-11-14 18:10:03 +00:00
namespace :activity_feeds do
desc 'Remove outdated activity feeds'
task :clear => :environment do
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