diff options
Diffstat (limited to 'activemodel/lib/active_model/validations/inclusion.rb')
-rw-r--r-- | activemodel/lib/active_model/validations/inclusion.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/activemodel/lib/active_model/validations/inclusion.rb b/activemodel/lib/active_model/validations/inclusion.rb index 2cfa1d6107..9fc1caaabe 100644 --- a/activemodel/lib/active_model/validations/inclusion.rb +++ b/activemodel/lib/active_model/validations/inclusion.rb @@ -10,15 +10,15 @@ module ActiveModel # end # # Configuration options: - # * <tt>in</tt> - An enumerable object of available items - # * <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 null (default is: false) - # * <tt>allow_blank</tt> - If set to true, skips this validation if the attribute is blank (default is: false) - # * <tt>if</tt> - Specifies a method, proc or string to call to determine if the validation should - # occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The + # * <tt>:in</tt> - An enumerable object of available items + # * <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 null (default is: +false+) + # * <tt>:allow_blank</tt> - If set to +true+, skips this validation if the attribute is blank (default is: +false+) + # * <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. - # * <tt>unless</tt> - Specifies a method, proc or string to call to determine if the validation should - # not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }). The + # * <tt>:unless</tt> - Specifies a method, proc or string to call to determine if the validation should + # not occur (e.g. <tt>:unless => :skip_validation</tt>, or <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>). The # method, proc or string should return or evaluate to a true or false value. def validates_inclusion_of(*attr_names) configuration = { :message => ActiveRecord::Errors.default_error_messages[:inclusion], :on => :save } |