Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Show object when throwing "non-persisted record" error #655

Merged
merged 3 commits into from Sep 23, 2014

Conversation

Projects
None yet
3 participants

Dorian commented May 2, 2014

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 <top (required)>'

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

@Dorian Dorian 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.
59f072d
Owner

albus522 commented Sep 19, 2014

Looks like you have some specs to fix

Dorian commented Sep 22, 2014

Oops, I forgot to look at that, I fixed the specs, and BTW, I needed to use rspec 2.14 (https://gist.github.com/Dorian/3948ca1323e9629ab00e).

Dorian Marié Merge branch 'master' of https://github.com/collectiveidea/delayed_job
…into patch-1

Conflicts:
	lib/delayed/backend/shared_spec.rb
	lib/delayed/performable_method.rb
941adb7

Coverage Status

Coverage increased (+0.04%) when pulling 941adb7 on Dorian:patch-1 into c0e0a81 on collectiveidea:master.

@albus522 albus522 added a commit that referenced this pull request Sep 23, 2014

@albus522 albus522 Merge pull request #655 from Dorian/patch-1
Show object when throwing "non-persisted record" error
f9a07f4

@albus522 albus522 merged commit f9a07f4 into collectiveidea:master Sep 23, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@Dorian Dorian deleted the Dorian:patch-1 branch Sep 23, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment