class Rubocop::Cop::Rails::Validation

This cop checks for the use of old-style attribute validation macros.

Constants

BLACKLIST
MSG

Public Instance Methods

on_send(node) click to toggle source
# File lib/rubocop/cop/rails/validation.rb, line 20
def on_send(node)
  receiver, method_name, *_args = *node

  if receiver.nil? && BLACKLIST.include?(method_name)
    add_offence(:convention, node.loc.selector, MSG)
  end
end