From 606376bd448a5d27cbcd5d23ad89a99d9d4fdb54 Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Fri, 5 Jan 2007 20:17:37 +0000 Subject: [DOCS] Document :allow_nil option of #validate_uniqueness_of. Closes #3143 [Caio Chassot] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5853 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/validations.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 342a4844cc..6f284242cd 100755 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -520,6 +520,7 @@ module ActiveRecord # * message - Specifies a custom error message (default is: "has already been taken") # * scope - One or more columns by which to limit the scope of the uniquness constraint. # * case_sensitive - Looks for an exact match. Ignored by non-text columns (true by default). + # * allow_nil - If set to true, skips this validation if the attribute is null (default is: false) # * if - 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 # method, proc or string should return or evaluate to a true or false value. -- cgit v1.2.3