Class: RuboCop::Cop::Rails::ApplicationJob
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Rails::ApplicationJob
- Extended by:
- AutoCorrector, TargetRailsVersion
- Includes:
- EnforceSuperclass
- Defined in:
- lib/rubocop/cop/rails/application_job.rb
Overview
Checks that jobs subclass ‘ApplicationJob` with Rails 5.0.
Constant Summary collapse
- MSG =
'Jobs should subclass `ApplicationJob`.'
- SUPERCLASS =
'ApplicationJob'
- BASE_PATTERN =
'(const (const {nil? cbase} :ActiveJob) :Base)'
Constants included from TargetRailsVersion
TargetRailsVersion::TARGET_GEM_NAME, TargetRailsVersion::USES_REQUIRES_GEM_API
Instance Method Summary collapse
-
#autocorrect(node) ⇒ Object
rubocop:enable Layout/ClassStructure.
Methods included from TargetRailsVersion
minimum_target_rails_version, support_target_rails_version?
Methods included from EnforceSuperclass
Instance Method Details
#autocorrect(node) ⇒ Object
rubocop:enable Layout/ClassStructure
37 38 39 40 41 |
# File 'lib/rubocop/cop/rails/application_job.rb', line 37 def autocorrect(node) lambda do |corrector| corrector.replace(node, self.class::SUPERCLASS) end end |