Permalink
Browse files

Add note that validates_length_of will incorrectly pluralize min. len…

…gth 1
  • Loading branch information...
1 parent 58dccf3 commit 77582075a66ca6fcd6959e29b4d6625021e67edf @kevinskoglund kevinskoglund committed Feb 7, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 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+

0 comments on commit 7758207

Please sign in to comment.