public
Description: Repository for improving Rails documentation
Homepage: http://www.rubyonrails.org
Clone URL: git://github.com/lifo/doc-rails.git
markup tweaks in ActiveModel::Validations docs
Xavier Noria (author)
Fri Apr 11 14:46:03 -0700 2008
commit  49a07f341ff8c6b50f2b33031ab78409fea23fa9
tree    795e511b398aa2278637d0eba42d46a7dad245ca
parent  b3767c65f09fed9562499a7a68f3293ad0d7f8fc
...
27
28
29
30
 
31
32
33
...
52
53
54
55
56
 
 
57
58
59
...
63
64
65
66
67
68
69
70
 
 
 
 
 
71
72
73
 
 
74
75
76
...
27
28
29
 
30
31
32
33
...
52
53
54
 
 
55
56
57
58
59
...
63
64
65
 
 
 
 
 
66
67
68
69
70
71
 
 
72
73
74
75
76
0
@@ -27,7 +27,7 @@ module ActiveModel
0
       DEFAULT_VALIDATION_OPTIONS = { :on => :save, :allow_nil => false, :allow_blank => false, :message => nil }.freeze
0
 
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
       #
0
       # This can be done with a symbol pointing to a method:
0
@@ -52,8 +52,8 @@ module ActiveModel
0
       # end
0
       # end
0
       #
0
- # This usage applies to #validate_on_create and #validate_on_update as well.
0
-
0
+ # This usage applies to +validate_on_create+ and +validate_on_update as well+.
0
+ #
0
       # Validates each attribute against a block.
0
       #
0
       # class Person < ActiveRecord::Base
0
@@ -63,14 +63,14 @@ module ActiveModel
0
       # end
0
       #
0
       # Options:
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.