aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorKevin Skoglund <kevin@novafabrica.com>2011-02-07 09:25:22 -0500
committerKevin Skoglund <kevin@novafabrica.com>2011-02-07 09:25:22 -0500
commit77582075a66ca6fcd6959e29b4d6625021e67edf (patch)
tree1182e0dc6f4b1ce1d4a7390faa781c0aabbefb0c /railties
parent58dccf305a63e5a77695206453a669bb3fffa17f (diff)
downloadrails-77582075a66ca6fcd6959e29b4d6625021e67edf.tar.gz
rails-77582075a66ca6fcd6959e29b4d6625021e67edf.tar.bz2
rails-77582075a66ca6fcd6959e29b4d6625021e67edf.zip
Add note that validates_length_of will incorrectly pluralize min. length 1
Diffstat (limited to 'railties')
-rw-r--r--railties/guides/source/active_record_validations_callbacks.textile2
1 files changed, 2 insertions, 0 deletions
diff --git a/railties/guides/source/active_record_validations_callbacks.textile b/railties/guides/source/active_record_validations_callbacks.textile
index a15571fe58..6f857ab9cc 100644
--- a/railties/guides/source/active_record_validations_callbacks.textile
+++ b/railties/guides/source/active_record_validations_callbacks.textile
@@ -314,6 +314,8 @@ class Essay < ActiveRecord::Base
end
</ruby>
+Note that the default error messages are plural (e.g., "is too short (minimum is %{count} characters)"). For this reason, when +:minimum+ is 1 you should provide a personalized message or use +validates_presence_of+ instead. When +:in+ or +:within+ have a lower limit of 1, you should either provide a personalized message or call +validates_presence_of+ prior to +validates_length_of+.
+
The +validates_size_of+ helper is an alias for +validates_length_of+.
h4. +validates_numericality_of+