title: Sidekiq worker perform a for_each on a model
body: <p>I have a worker which needs to loop through many models and save some data into DB.</p>
  
  <pre><code>def perform()
    Project.for_each do |project|
     project.subprojects.for_each do |ps|
      Result.create(ps_id: ps.id)
     end
    end
  end
  </code></pre>
  
  <p>I get as a error:</p>
  
  <p>' "enqueued_at"=>1381919287.982079, "error_message"=>"undefined method <code>for_each' for #&lt;Class:0x007fe5c6b14b40&gt;", "error_class"=&gt;"NoMethodError", "failed_at"=&gt;"2013-10-16T10:29:18Z", "retry_count"=&gt;1, "retried_at"=&gt;2013-10-16 10:30:03 UTC}
  2013-10-16T10:30:03Z 12893 TID-ox92y34ec WARN: undefined method</code>for_each' for #  </p>