This blog is part of our Rails 5 series.
Rails 5 has added another base class
which inherits from
Now by default all new Rails 5 applications will have
In Rails 4.x if we want to use
then first we need to generate a job and all the generated jobs directly inherit from
Rails 5 adds explicit base class
As you can see this is not a big change but it is a good change in
terms of being consistent with how controllers have
ApplicationJob will be a single place to apply all kind of customizations and extensions needed for an application, instead of applying patch on
Upgrading from Rails 4.x
When upgrading from Rails 4.x to Rails 5 we need to create
and add the following content.
We also need to change all the existing job classes to inherit from
ApplicationJob instead of
Here is the revised code of