collectiveidea/delayed_job — pull request #307 by trek (2011-11-20 22:29:45+00:00)
Title: raise ArgumentError if attempting to enqueue a performable method on an object that hasn't been persisted yet

Delaying a method invokation on an object that hasn't been persisted yet (and therefore doesn't have a primary key) will currently save but results in deserialization exceptions when later processed.

This is the opposite end of the deserialization problem (#282 and #296), and is noted in #183. I had to change the callbacks specs to `Story.create` instead of `Story.new`. I couldn't tell if callbacks on unpersisted objects was a specifically desirable behavior or just one that didn't matter for those specific specs.

I didn't add any behavior for similar failures on Mongoid.