collectiveidea/delayed_job — pull request #655 by Dorian (2014-05-02 16:25:11+00:00)
Title: Show object when throwing "non-persisted record" error

When calling `delay` on a non-persisted record, the error raised now also contains the details about the object.

This make debugging this error easier. And is consistent with the previous error.

Basically I had errors like:

Failure/Error: product.destroy
ArgumentError:
Jobs cannot be created for non-persisted records
# ./spec/models/product_spec.rb:18:in `block (3 levels) in '

But there is no actual details about the record that was not persisted here (eg: it's not the product)