aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/validations
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-03-12 10:51:10 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-03-12 10:51:10 -0300
commit591b8f395d101ad1a3b009b98de0e6bd2a5d6222 (patch)
tree9fc4ef3424de7f2fff454e0b48727900ada8b967 /activerecord/lib/active_record/validations
parent79ceae6241f612f866ff2b8670788feaf199b96f (diff)
parent501ae92a32285528c8bbdcf2af422eadb6a63c0e (diff)
downloadrails-591b8f395d101ad1a3b009b98de0e6bd2a5d6222.tar.gz
rails-591b8f395d101ad1a3b009b98de0e6bd2a5d6222.tar.bz2
rails-591b8f395d101ad1a3b009b98de0e6bd2a5d6222.zip
Merge pull request #13040 from kamipo/case_sensitive_comparison
Only use BINARY for mysql case sensitive uniqueness check when column has a case insensitive collation. Conflicts: activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord/lib/active_record/validations')
-rw-r--r--activerecord/lib/active_record/validations/uniqueness.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/validations/uniqueness.rb b/activerecord/lib/active_record/validations/uniqueness.rb
index 82c2b9439b..71c71cb4b1 100644
--- a/activerecord/lib/active_record/validations/uniqueness.rb
+++ b/activerecord/lib/active_record/validations/uniqueness.rb
@@ -68,8 +68,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