class RuboCop::Cop::Rails::ApplicationJob
end
# …
class Rails4Job < ActiveJob::Base
# bad
end
# …
class Rails5Job < ApplicationJob
# good
@example
sneak into a job that is not purposed to inherit logic common among other jobs.
This cop’s autocorrection is unsafe because it may let the logic from ‘ApplicationJob`
@safety
Checks that jobs subclass `ApplicationJob` with Rails 5.0.
def autocorrect(node)
def autocorrect(node) lambda do |corrector| corrector.replace(node, self.class::SUPERCLASS) end end