Class: RuboCop::Cop::Betterment::ActiveJobPerformable
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::Betterment::ActiveJobPerformable
- Defined in:
- lib/rubocop/cop/betterment/active_job_performable.rb
Constant Summary collapse
- MSG =
" Classes that are \"performable\" should be ActiveJobs\n\n class MyJob < ApplicationJob\n def perform\n end\n end\n\n You can learn more about ActiveJob here:\n https://guides.rubyonrails.org/active_job_basics.html\n".freeze
Instance Method Summary collapse
Instance Method Details
#on_class(node) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/rubocop/cop/betterment/active_job_performable.rb', line 25 def on_class(node) return unless has_perform_method?(node) return if subclasses_application_job?(node) add_offense(node.children.first) end |