File: //usr/local/rvm/gems/default/doc/activemodel-6.1.4.1/ri/ActiveModel/Validations/validates_with-i.ri
U:RDoc::AnyMethod[iI"validates_with:ETI",ActiveModel::Validations#validates_with;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"MPasses the record off to the class or classes specified and allows them ;TI"4to add errors based on more complex conditions.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"class Person
;TI"( include ActiveModel::Validations
;TI"
;TI"& validate :instance_validations
;TI"
;TI" def instance_validations
;TI"$ validates_with MyValidator
;TI" end
;TI" end
;T:@format0o;
; [I"KPlease consult the class method documentation for more information on ;TI"!creating your own validator.;T@o;
; [I"4You may also pass it multiple classes, like so:;T@o;; [I"class Person
;TI"( include ActiveModel::Validations
;TI"
;TI"3 validate :instance_validations, on: :create
;TI"
;TI" def instance_validations
;TI"6 validates_with MyValidator, MyOtherValidator
;TI" end
;TI" end
;T;
0o;
; [ I"DStandard configuration options (<tt>:on</tt>, <tt>:if</tt> and ;TI"D<tt>:unless</tt>), which are available on the class version of ;TI"J+validates_with+, should instead be placed on the +validates+ method ;TI"5as these are applied and tested in the callback.;T@o;
; [I"KIf you pass any additional configuration options, they will be passed ;TI"Bto the class and available as +options+, please refer to the ;TI"7class version of this method for more information.;T:
@fileI")lib/active_model/validations/with.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(*args, &block);T@8FI"Validations;TcRDoc::NormalModule00