title: Rails: whenever + delayed_job to optimize rake tasks?
body: <p>I use <strong>whenever</strong> to call rake tasks throughout the day, but each task launches a new Rails environment. How can I run tasks throughout the day without relaunching Rails for each job?</p>
  
  <p>Here's what I came up with, would love to get some feedback on this...?</p>
  
  <ol>
  <li><p>Refactor each rake task to instead be a method within the appropriate Model.</p></li>
  <li><p>Use the <strong>delayed_job</strong> gem to assign low priority and ensure these methods run asynchronously.</p></li>
  <li><p>Instruct <strong>whenever</strong> to call each Model.method instead of calling the rake task</p></li>
  </ol>
  
  <p>Does this solution make sense? Will it help avoid launching a new Rails environment for each job? .. or is there a better way to do this?</p>
  
  <p>--</p>
  
  <p>Running Rails 3</p>