Sha256: bfcdd6b5ffdcdadff37c580d723139031c41faf537b68022c40034f523115588
Contents?: true
Size: 924 Bytes
Versions: 5
Compression:
Stored size: 924 Bytes
Contents
# encoding: utf-8 module Rubocop module Cop module Rails # This cop checks for the use of old-style attribute validation macros. class Validation < Cop MSG = 'Use the new "sexy" validations (validates ...).' BLACKLIST = [:validates_acceptance_of, :validates_confirmation_of, :validates_exclusion_of, :validates_format_of, :validates_inclusion_of, :validates_length_of, :validates_numericality_of, :validates_presence_of, :validates_size_of, :validates_uniqueness_of] def on_send(node) receiver, method_name, *_args = *node if receiver.nil? && BLACKLIST.include?(method_name) convention(node, :selector) end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems