From 501ae92a32285528c8bbdcf2af422eadb6a63c0e Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Tue, 26 Nov 2013 04:59:18 +0900 Subject: Only use BINARY for mysql case sensitive uniqueness check when column has a case insensitive collation. --- activerecord/lib/active_record/validations/uniqueness.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'activerecord/lib/active_record/validations') diff --git a/activerecord/lib/active_record/validations/uniqueness.rb b/activerecord/lib/active_record/validations/uniqueness.rb index 38f37f5c8a..412c0cc18a 100644 --- a/activerecord/lib/active_record/validations/uniqueness.rb +++ b/activerecord/lib/active_record/validations/uniqueness.rb @@ -59,8 +59,7 @@ module ActiveRecord # will use SQL LOWER function before comparison, unless it detects a case insensitive collation klass.connection.case_insensitive_comparison(table, attribute, column, value) else - value = klass.connection.case_sensitive_modifier(value) unless value.nil? - table[attribute].eq(value) + klass.connection.case_sensitive_comparison(table, attribute, column, value) end end -- cgit v1.2.3