From c99169c435327ddcce54b2cd25e61e3f63edb514 Mon Sep 17 00:00:00 2001 From: Kevin Skoglund Date: Fri, 4 Feb 2011 11:02:53 -0500 Subject: [PATCH] Add note to guides regarding validates_length_of error message pluralization [state:resolved] --- .../active_record_validations_callbacks.textile | 2 ++ 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 a15571f..6f857ab 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 +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+ -- 1.7.1.1