Sha256: 392d8308ef0495f53c990e8da7f95674bf4276fa9431ec099808705f7af44e57
Contents?: true
Size: 925 Bytes
Versions: 2
Compression:
Stored size: 925 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) add_offense(node, :selector) end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rubocop-0.19.1 | lib/rubocop/cop/rails/validation.rb |
rubocop-0.19.0 | lib/rubocop/cop/rails/validation.rb |