提交 98d2d8ce 编写于 作者: A Aaron Patterson 提交者: wycats

use the database to lower case strings rather than ruby. [#4293 state:resolved]

Signed-off-by: Nwycats <wycats@gmail.com>
上级 4ea289fb
......@@ -67,13 +67,11 @@ def mount_sql_and_params(klass, table_name, attribute, value) #:nodoc:
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册