# File activerecord/lib/active_record/validations.rb, line 291def validates_each(*attrs)options=attrs.last.is_a?(Hash)?attrs.pop.symbolize_keys:{}attrs=attrs.flatten# Declare the validation.send(validation_method(options[:on]||:save))do|record|# Don't validate when there is an :if condition and that condition is falseunlessoptions[:if]&&!evaluate_condition(options[:if],record)attrs.eachdo|attr|value=record.send(attr)nextifvalue.nil?&&options[:allow_nil]yieldrecord,attr,valueendendendend