lib/active_model/validator.rb in activemodel-6.1.7.10 vs lib/active_model/validator.rb in activemodel-7.0.0.alpha1

- old
+ new

@@ -127,11 +127,11 @@ # +EachValidator+ is a validator which iterates through the attributes given # in the options hash invoking the <tt>validate_each</tt> method passing in the # record, attribute and value. # # All \Active \Model validations are built on top of this validator. - class EachValidator < Validator #:nodoc: + class EachValidator < Validator attr_reader :attributes # Returns a new validator instance. All options will be available via the # +options+ reader, however the <tt>:attributes</tt> option will be removed # and instead be made available through the +attributes+ reader. @@ -172,10 +172,10 @@ end end # +BlockValidator+ is a special +EachValidator+ which receives a block on initialization # and call this block for each attribute being validated. +validates_each+ uses this validator. - class BlockValidator < EachValidator #:nodoc: + class BlockValidator < EachValidator # :nodoc: def initialize(options, &block) @block = block super end