Class: RuboCop::Cop::Workit::ActionArgs

Inherits:
Base
  • Object
show all
Defined in:
lib/rubocop/cop/workit/action_args.rb

Overview

Check for controller action must be using ‘action_args`.

Examples:

# bad
class FooController
  def index
    # ...
  end
end

# good
class FooController
  def index(foo:)
    # ...
  end

  def not_action
    # ...
  end
end

Constant Summary collapse

MSG =
"Consider using `action_args`."

Instance Method Summary collapse

Instance Method Details

#on_def(node) ⇒ Object



30
31
32
# File 'lib/rubocop/cop/workit/action_args.rb', line 30

def on_def(node)
  add_offense(node) if !node.arguments? && controller_methods.include?(node.method_name.to_s)
end