Parent

Files

Class/Module Index [+]

Quicksearch

RuboCop::Cop::Rails::ActionFilter

This cop enforces the consistent use of action filters methods.

The cop is configurable and the enforce the use of older something_filter methods or the newer something_action methods.

Public Instance Methods

autocorrect(node) click to toggle source
# File lib/rubocop/cop/rails/action_filter.rb, line 32
def autocorrect(node)
  @corrections << lambda do |corrector|
    corrector.replace(node.loc.selector,
                      preferred_method(node.loc.selector.source).to_s)
  end
end
on_block(node) click to toggle source
# File lib/rubocop/cop/rails/action_filter.rb, line 20
def on_block(node)
  method, _args, _body = *node

  check_method_node(method)
end
on_send(node) click to toggle source
# File lib/rubocop/cop/rails/action_filter.rb, line 26
def on_send(node)
  receiver, _method_name, *_args = *node

  check_method_node(node) if receiver.nil?
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.