collectiveidea/delayed_job — pull request #474 by aarongowatch (2013-02-03 22:20:31+00:00)
Title: Work off result fix

I encountered an issue with `::Delayed::Worker#failed` where calling `destroy` on the failed job would cause the loop in `work_off` to break and miscount the failure because `destroy` returns the object being destroyed and the caller expects true/false:

```ruby
num.times do
case reserve_and_run_one_job
when true
success += 1
when false
failure += 1
else
break # leave if no work could be done
end
break if stop? # leave if we're exiting
end
```

This changes `::Delayed::Worker#failed` to return false on `destroy` instead of the AR object.