collectiveidea/delayed_job — pull request #733 by neilgupta (2014-10-31 16:13:28+00:00)
Title: Fix undefined local variable or method `klass'

Jobs sometimes fail to load in 4.0.4 with the following error:

```
Job failed to load: undefined local variable or method `klass' for #. Handler: "--- [delayed job object yaml]"
/app/vendor/bundle/ruby/2.1.0/gems/delayed_job-4.0.4/lib/delayed/backend/base.rb:87:in `rescue in payload_object'
/app/vendor/bundle/ruby/2.1.0/gems/delayed_job-4.0.4/lib/delayed/backend/base.rb:85:in `payload_object'
/app/vendor/bundle/ruby/2.1.0/gems/delayed_job-4.0.4/lib/delayed/backend/base.rb:132:in `max_run_time'
/app/vendor/bundle/ruby/2.1.0/gems/delayed_job-4.0.4/lib/delayed/worker.rb:260:in `max_run_time'
/app/vendor/bundle/ruby/2.1.0/gems/delayed_job-4.0.4/lib/delayed/worker.rb:199:in `block in run'
```

The problem is that klass and id are not defined when deserializing objects, causing an undefined error when trying to raise a DeserializationError for deleted AR objects.