Skip to content

Instantly share code, notes, and snippets.

@kivanio
Forked from ArionHardison/gist:6782033
Created April 2, 2014 21:32
Show Gist options
  • Save kivanio/9943612 to your computer and use it in GitHub Desktop.
Save kivanio/9943612 to your computer and use it in GitHub Desktop.
class DailyWorker
include Sidekiq::Worker
include Sidetiq::Schedulable
# Daily at midnight
recurrence { daily }
def perform
User.includes(:profile).where("profiles.daily_email" => true) do |u|
ReminderMailer.remind_email(u).deliver
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment