Where should I put background processes in rails?
I'm building a Rails project that has a cron-type job that I'm managing with Rufus Scheduler. I have two questions about how to set this up appropriately in Rails: Where's the best place to put the job's code? Where should I place the Rufus code to schedule the job? How should I kick it off? To control the scheduler I would create a config/initializers/task_scheduler.rb : task_scheduler = Rufus::Scheduler.start_new task_scheduler.every("1m") do Something.to_do! # Do something every minute! end Now for the Something.to_do code, that sort of depends on what it does. Perhaps it is a data model