0
@@ -27,7 +27,7 @@ module ActiveModel
0
DEFAULT_VALIDATION_OPTIONS = { :on => :save, :allow_nil => false, :allow_blank => false, :message => nil }.freeze
0
# Adds a validation method or block to the class. This is useful when
0
- # overriding the
#validate instance method becomes too unwieldly and
0
+ # overriding the
+validate+ instance method becomes too unwieldly and
0
# you're looking for more descriptive declaration of your validations.
0
# This can be done with a symbol pointing to a method:
0
@@ -52,8 +52,8 @@ module ActiveModel
0
- # This usage applies to #validate_on_create and #validate_on_update as well.
0
+ # This usage applies to +validate_on_create+ and +validate_on_update as well+.
0
# Validates each attribute against a block.
0
# class Person < ActiveRecord::Base
0
@@ -63,14 +63,14 @@ module ActiveModel
0
- # * <tt>on</tt> - Specifies when this validation is active (default is :save, other options :create, :update)
0
- # * <tt>allow_nil</tt> - Skip validation if attribute is nil.
0
- # * <tt>allow_blank</tt> - Skip validation if attribute is blank.
0
- # * <tt>if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
- # occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The
0
+ # * <tt>:on</tt> - Specifies when this validation is active (default is <tt>:save</tt>, other options <tt>:create</tt>, <tt>:update</tt>)
0
+ # * <tt>:allow_nil</tt> - Skip validation if attribute is +nil+.
0
+ # * <tt>:allow_blank</tt> - Skip validation if attribute is blank.
0
+ # * <tt>:if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+ # occur (e.g. <tt>:if => :allow_validation</tt>, or <tt>:if => Proc.new { |user| user.signup_step > 2 }</tt>). The
0
# method, proc or string should return or evaluate to a true or false value.
0
- # * <tt>unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
- # not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }). The
0
+ # * <tt>:unless</tt> - Specifies a method, proc or string to call to determine if the validation should
0
+ # not occur (e.g. <tt>:unless => :skip_validation</tt>, or <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>). The
0
# method, proc or string should return or evaluate to a true or false value.
0
def validates_each(*attrs)
0
options = attrs.extract_options!.symbolize_keys
Comments
No one has commented yet.