Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source
Show
Ignore:
Timestamp:
04/10/08 18:06:05 (8 months ago)
Author:
rick
Message:

Change validates_uniqueness_of :case_sensitive option default back to true (from [9160]). Love your database columns, don't LOWER them. [rick]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/CHANGELOG

    r9247 r9248  
    11*SVN* 
     2 
     3* Change validates_uniqueness_of :case_sensitive option default back to true (from [9160]).  Love your database columns, don't LOWER them.  [rick] 
    24 
    35* Ensure that save on child object fails for invalid belongs_to association. Closes #11555. [rubyruy] 
  • trunk/activerecord/lib/active_record/validations.rb

    r9226 r9248  
    604604      # * <tt>message</tt> - Specifies a custom error message (default is: "has already been taken") 
    605605      # * <tt>scope</tt> - One or more columns by which to limit the scope of the uniqueness constraint. 
    606       # * <tt>case_sensitive</tt> - Looks for an exact match.  Ignored by non-text columns (false by default). 
     606      # * <tt>case_sensitive</tt> - Looks for an exact match.  Ignored by non-text columns (true by default). 
    607607      # * <tt>allow_nil</tt> - If set to true, skips this validation if the attribute is null (default is: false) 
    608608      # * <tt>allow_blank</tt> - If set to true, skips this validation if the attribute is blank (default is: false) 
     
    614614      #   method, proc or string should return or evaluate to a true or false value. 
    615615      def validates_uniqueness_of(*attr_names) 
    616         configuration = { :message => ActiveRecord::Errors.default_error_messages[:taken]
     616        configuration = { :message => ActiveRecord::Errors.default_error_messages[:taken], :case_sensitive => true
    617617        configuration.update(attr_names.extract_options!) 
    618618