module ActiveModel::Validations::ClassMethods

def validates_each(*attr_names, &block)

value.
method, proc, or string should return or evaluate to a +true+ or +false+
or unless: Proc.new { |user| user.signup_step <= 2 }). The
determine if the validation should not occur (e.g. unless: :skip_validation,
* :unless - Specifies a method, proc, or string to call to
proc or string should return or evaluate to a +true+ or +false+ value.
or if: Proc.new { |user| user.signup_step > 2 }). The method,
if the validation should occur (e.g. if: :allow_validation,
* :if - Specifies a method, proc, or string to call to determine
* :allow_blank - Skip validation if attribute is blank.
* :allow_nil - Skip validation if attribute is +nil+.
on: [:create, :custom_validation_context])
on: :custom_validation_context or
or an array of symbols. (e.g. on: :create or
Runs in all validation contexts by default +nil+. You can pass a symbol
* :on - Specifies the contexts where this validation is active.
Options:

end
end
record.errors.add attr, "starts with z." if value.start_with?("z")
validates_each :first_name, :last_name, allow_blank: true do |record, attr, value|

attr_accessor :first_name, :last_name

include ActiveModel::Validations
class Person

Validates each attribute against a block.
def validates_each(*attr_names, &block)
  validates_with BlockValidator, _merge_attributes(attr_names), &block
end