aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/validations/uniqueness.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/validations/uniqueness.rb b/activerecord/lib/active_record/validations/uniqueness.rb
index e28808df98..4806fa0ecc 100644
--- a/activerecord/lib/active_record/validations/uniqueness.rb
+++ b/activerecord/lib/active_record/validations/uniqueness.rb
@@ -67,13 +67,11 @@ module ActiveRecord
if value.nil? || (options[:case_sensitive] || !column.text?)
sql = "#{sql_attribute} #{operator}"
- params = [value]
else
- sql = "LOWER(#{sql_attribute}) #{operator}"
- params = [value.mb_chars.downcase]
+ sql = "LOWER(#{sql_attribute}) = LOWER(?)"
end
- [sql, params]
+ [sql, [value]]
end
end