Sha256: 6b4670207a27c8619bd15557d99bb44e5d90998458523fa1481303c3cd1eb371
Contents?: true
Size: 927 Bytes
Versions: 3
Compression:
Stored size: 927 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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rubocop-0.21.0 | lib/rubocop/cop/rails/validation.rb |
rubocop-0.20.1 | lib/rubocop/cop/rails/validation.rb |
rubocop-0.20.0 | lib/rubocop/cop/rails/validation.rb |