Skip to content
Browse files

Added info about validates_size_of, as being an alias for validates_l…

…ength_of
  • Loading branch information...
1 parent d0cb4d7 commit 6f944c06c86fcf30f257202fa10f0ccad6014ef5 @cassiomarques cassiomarques committed Nov 10, 2008
View
6 railties/doc/guides/html/activerecord_validations_callbacks.html
@@ -235,8 +235,6 @@ <h2 id="site_title_tagline">Sustainable productivity for web-application develop
<li><a href="#_the_tt_validates_presence_of_tt_helper">The <tt>validates_presence_of</tt> helper</a></li>
- <li><a href="#_the_tt_validates_size_of_tt_helper">The <tt>validates_size_of</tt> helper</a></li>
-
<li><a href="#_the_validates_uniqueness_of_helper">The validates_uniqueness_of+ helper</a></li>
</ul>
@@ -524,6 +522,7 @@ <h3 id="_the_tt_validates_length_of_tt_helper">3.8. The <tt>validates_length_of<
validates_length_of <span style="color: #990000">:</span>bio<span style="color: #990000">,</span> <span style="color: #990000">:</span>too_long <span style="color: #990000">=&gt;</span> <span style="color: #FF0000">"you're writing too much. %d characters is the maximum allowed."</span>
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
</tt></pre></div></div>
+<div class="para"><p>This helper has an alias called <tt>validates_size_of</tt>, it's the same helper with a different name. You can use it if you'd like to.</p></div>
<h3 id="_the_tt_validates_numericallity_of_tt_helper">3.9. The <tt>validates_numericallity_of</tt> helper</h3>
<div class="para"><p>This helper validates that your attributes have only numeric values. By default, it will match an optional sign followed by a integral or floating point number. Using the <tt>:integer_only</tt> option set to true, you can specify that only integral numbers are allowed.</p></div>
<div class="para"><p>If you use <tt>:integer_only</tt> set to <tt>true</tt>, then it will use the <tt><span>/\A[+\-]?\d+\Z/</span></tt> regular expression to validate the attribute's value. Otherwise, it will try to convert the value using <tt>Kernel.Float</tt>.</p></div>
@@ -576,8 +575,7 @@ <h3 id="_the_tt_validates_presence_of_tt_helper">3.10. The <tt>validates_presenc
</tr></table>
</div>
<div class="para"><p>The default error message for <tt>validates_presence_of</tt> is "<em>can't be empty</em>".</p></div>
-<h3 id="_the_tt_validates_size_of_tt_helper">3.11. The <tt>validates_size_of</tt> helper</h3>
-<h3 id="_the_validates_uniqueness_of_helper">3.12. The validates_uniqueness_of+ helper</h3>
+<h3 id="_the_validates_uniqueness_of_helper">3.11. The validates_uniqueness_of+ helper</h3>
</div>
<h2 id="_common_validation_options">4. Common validation options</h2>
<div class="sectionbody">
View
4 railties/doc/guides/source/activerecord_validations_callbacks.txt
@@ -219,6 +219,8 @@ class Person < ActiveRecord::Base
end
------------------------------------------------------------------
+This helper has an alias called +validates_size_of+, it's the same helper with a different name. You can use it if you'd like to.
+
=== The +validates_numericallity_of+ helper
This helper validates that your attributes have only numeric values. By default, it will match an optional sign followed by a integral or floating point number. Using the +:integer_only+ option set to true, you can specify that only integral numbers are allowed.
@@ -260,8 +262,6 @@ NOTE: If you want to validate the presence of a boolean field (where the real va
The default error message for +validates_presence_of+ is "_can't be empty_".
-=== The +validates_size_of+ helper
-
=== The validates_uniqueness_of+ helper
== Common validation options

0 comments on commit 6f944c0

Please sign in to comment.
Something went wrong with that request. Please try again.