aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/validations/presence.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-02-21 11:42:26 +0100
committerXavier Noria <fxn@hashref.com>2011-02-21 11:42:26 +0100
commitf826e058355606d1b0503b0395519728335324f4 (patch)
tree4ad040efe6e5691bb408e8ebc0b6df4a216a1730 /activemodel/lib/active_model/validations/presence.rb
parentcd12c369961a612f6b083fc0e3b877cf59b737f4 (diff)
parentb481574a33764e2db1caf01c233a9c9ac9723780 (diff)
downloadrails-f826e058355606d1b0503b0395519728335324f4.tar.gz
rails-f826e058355606d1b0503b0395519728335324f4.tar.bz2
rails-f826e058355606d1b0503b0395519728335324f4.zip
Merge branch 'master' of git://github.com/lifo/docrails
Diffstat (limited to 'activemodel/lib/active_model/validations/presence.rb')
-rw-r--r--activemodel/lib/active_model/validations/presence.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/activemodel/lib/active_model/validations/presence.rb b/activemodel/lib/active_model/validations/presence.rb
index 28c4640b17..cfb4c33dcc 100644
--- a/activemodel/lib/active_model/validations/presence.rb
+++ b/activemodel/lib/active_model/validations/presence.rb
@@ -26,8 +26,9 @@ module ActiveModel
#
# Configuration options:
# * <tt>message</tt> - A custom error message (default is: "can't be blank").
- # * <tt>on</tt> - Specifies when this validation is active (default is <tt>:save</tt>, other options <tt>:create</tt>,
- # <tt>:update</tt>).
+ # * <tt>:on</tt> - Specifies when this validation is active. Runs in all
+ # validation contexts by default (+nil+), other options are <tt>:create</tt>
+ # and <tt>:update</tt>.
# * <tt>if</tt> - Specifies a method, proc or string to call to determine if the validation should
# occur (e.g. <tt>:if => :allow_validation</tt>, or <tt>:if => Proc.new { |user| user.signup_step > 2 }</tt>).
# The method, proc or string should return or evaluate to a true or false value.