diff options
author | Xavier Noria <fxn@hashref.com> | 2011-02-21 11:42:26 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-02-21 11:42:26 +0100 |
commit | f826e058355606d1b0503b0395519728335324f4 (patch) | |
tree | 4ad040efe6e5691bb408e8ebc0b6df4a216a1730 /activemodel/lib/active_model/validations/inclusion.rb | |
parent | cd12c369961a612f6b083fc0e3b877cf59b737f4 (diff) | |
parent | b481574a33764e2db1caf01c233a9c9ac9723780 (diff) | |
download | rails-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/inclusion.rb')
-rw-r--r-- | activemodel/lib/active_model/validations/inclusion.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/validations/inclusion.rb b/activemodel/lib/active_model/validations/inclusion.rb index 3ee2a3ccd1..92ac940f36 100644 --- a/activemodel/lib/active_model/validations/inclusion.rb +++ b/activemodel/lib/active_model/validations/inclusion.rb @@ -38,6 +38,9 @@ module ActiveModel # * <tt>:message</tt> - Specifies a custom error message (default is: "is not included in the list"). # * <tt>:allow_nil</tt> - If set to true, skips this validation if the attribute is +nil+ (default is +false+). # * <tt>:allow_blank</tt> - If set to true, skips this validation if the attribute is blank (default is +false+). + # * <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. |