rails/activejob — pull request #100 by timriley (2014-07-29 00:20:59+00:00)
Title: Fix database serialization of job class names with Que

This change fixes a breakage with using the Que adapter and serializing jobs to the database (as opposed to Que's `:sync` mode, which is used in the Active Job tests, and doesn't seralize jobs to the database).

When passing the job class constant as the first `#enqueue` argument, Que’s stored procedures serialize it to JSON in the database as `{}`. This means that when the job (the ActiveJob “wrapper”) is deserialized from the database, it can’t find the original job class to run again.

Changing the Que adapter to serialize the job class as a string fixes this behaviour. This change makes the adapter consistent with other adapters too (which constantize a class string in their `JobWrapper#perform` methods).

All the tests still pass with this change. I wasn't sure if it needed any new ones added. What it really needs to exercise to change are some integration-style tests, but it looks like this sort of thing doesn't exist in Active Job yet. Would it be OK to merge this as-is, then?

Thanks!