diff options
author | Rick Olson <technoweenie@gmail.com> | 2008-04-10 18:06:05 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2008-04-10 18:06:05 +0000 |
commit | ed99dda174da439a0947cdabea3babf027c672ac (patch) | |
tree | 4bb8781de7a4bf99d93d577446b2b74537332fe4 /activerecord/lib/active_record | |
parent | c67e985994362290308073ed2793dd8e7f2a76db (diff) | |
download | rails-ed99dda174da439a0947cdabea3babf027c672ac.tar.gz rails-ed99dda174da439a0947cdabea3babf027c672ac.tar.bz2 rails-ed99dda174da439a0947cdabea3babf027c672ac.zip |
Change validates_uniqueness_of :case_sensitive option default back to true (from [9160]). Love your database columns, don't LOWER them. [rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9248 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-x | activerecord/lib/active_record/validations.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index bd1c67cd84..86cda9aa66 100755 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -603,7 +603,7 @@ module ActiveRecord # Configuration options: # * <tt>message</tt> - Specifies a custom error message (default is: "has already been taken") # * <tt>scope</tt> - One or more columns by which to limit the scope of the uniqueness constraint. - # * <tt>case_sensitive</tt> - Looks for an exact match. Ignored by non-text columns (false by default). + # * <tt>case_sensitive</tt> - Looks for an exact match. Ignored by non-text columns (true by default). # * <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 @@ -613,7 +613,7 @@ module ActiveRecord # not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }). The # method, proc or string should return or evaluate to a true or false value. def validates_uniqueness_of(*attr_names) - configuration = { :message => ActiveRecord::Errors.default_error_messages[:taken] } + configuration = { :message => ActiveRecord::Errors.default_error_messages[:taken], :case_sensitive => true } configuration.update(attr_names.extract_options!) validates_each(attr_names,configuration) do |record, attr_name, value| |