public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Search Repo:
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
technoweenie (author)
Thu Apr 10 11:06:05 -0700 2008
commit  ed99dda174da439a0947cdabea3babf027c672ac
tree    4bb8781de7a4bf99d93d577446b2b74537332fe4
parent  c67e985994362290308073ed2793dd8e7f2a76db
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *SVN*
0
 
0
+* Change validates_uniqueness_of :case_sensitive option default back to true (from [9160]). Love your database columns, don't LOWER them. [rick]
0
+
0
 * Ensure that save on child object fails for invalid belongs_to association. Closes #11555. [rubyruy]
0
 
0
 * Add support for interleaving migrations by storing which migrations have run in the new schema_migrations table. Closes #11493 [jordi]
...
603
604
605
606
 
607
608
609
...
613
614
615
616
 
617
618
619
...
603
604
605
 
606
607
608
609
...
613
614
615
 
616
617
618
619
0
@@ -603,7 +603,7 @@
0
       # Configuration options:
0
       # * <tt>message</tt> - Specifies a custom error message (default is: "has already been taken")
0
       # * <tt>scope</tt> - One or more columns by which to limit the scope of the uniqueness constraint.
0
- # * <tt>case_sensitive</tt> - Looks for an exact match. Ignored by non-text columns (false by default).
0
+ # * <tt>case_sensitive</tt> - Looks for an exact match. Ignored by non-text columns (true by default).
0
       # * <tt>allow_nil</tt> - If set to true, skips this validation if the attribute is null (default is: false)
0
       # * <tt>allow_blank</tt> - If set to true, skips this validation if the attribute is blank (default is: false)
0
       # * <tt>if</tt> - Specifies a method, proc or string to call to determine if the validation should
0
@@ -613,7 +613,7 @@
0
       # not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }). The
0
       # method, proc or string should return or evaluate to a true or false value.
0
       def validates_uniqueness_of(*attr_names)
0
- configuration = { :message => ActiveRecord::Errors.default_error_messages[:taken] }
0
+ configuration = { :message => ActiveRecord::Errors.default_error_messages[:taken], :case_sensitive => true }
0
         configuration.update(attr_names.extract_options!)
0
 
0
         validates_each(attr_names,configuration) do |record, attr_name, value|

Comments

    No one has commented yet.