class RuboCop::Cop::Rails::Validation

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

def on_send(node)

def on_send(node)
  receiver, method_name, *_args = *node
  return unless receiver.nil? && BLACKLIST.include?(method_name)
  add_offense(node,
              :selector,
              format(MSG,
                     preferred_method(method_name),
                     method_name))
end

def preferred_method(method)

def preferred_method(method)
  WHITELIST[BLACKLIST.index(method.to_sym)]
end