Skip to content
Snippets Groups Projects
Commit 63c92189 authored by Gregor Schmidt's avatar Gregor Schmidt
Browse files

relaxing the test for mysql to make it work for mysql2 adapter

parent 98f85b33
No related merge requests found
......@@ -279,7 +279,7 @@ class User < Principal
# version. Exact matches will be given priority.
def self.find_by_login(login)
# force string comparison to be case sensitive on MySQL
type_cast = (ActiveRecord::Base.connection.adapter_name == 'MySQL') ? 'BINARY' : ''
type_cast = (ActiveRecord::Base.connection.adapter_name =~ /mysql/) ? 'BINARY' : ''
# First look for an exact match
user = first(:conditions => ["#{type_cast} login = ?", login])
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment