Skip to content

Instantly share code, notes, and snippets.

@RogerPodacter
Created November 28, 2010 17:42
Show Gist options
  • Select an option

  • Save RogerPodacter/719123 to your computer and use it in GitHub Desktop.

Select an option

Save RogerPodacter/719123 to your computer and use it in GitHub Desktop.
cron.rake
# This is all in cron.rake (I have the hourly cron add-on)
if Time.zone.now.hour == 0
User.send_later(:send_daily_leaderboard_email) # do this once per day
if Time.zone.now.strftime("%w").to_i == 0
ReportMailer.send_later(:deliver_manager_activity_report, 1.week.ago) # do this once per week
end
if Time.zone.now.strftime("%e").to_i == 1
ReportMailer.send_later(:deliver_manager_activity_report, 1.month.ago) # do this once per month
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment