diff --git a/lib/authlogic/acts_as_authentic/login.rb b/lib/authlogic/acts_as_authentic/login.rb index b518e344..a316da3c 100644 --- a/lib/authlogic/acts_as_authentic/login.rb +++ b/lib/authlogic/acts_as_authentic/login.rb @@ -118,7 +118,8 @@ def find_with_case(field, value, sensitivity = true) if sensitivity send("find_by_#{field}", value) else - where("LOWER(#{quoted_table_name}.#{field}) = ?", value.mb_chars.downcase).first + like_word = ::ActiveRecord::Base.connection.adapter_name == "PostgreSQL" ? "ILIKE" : "LIKE" + where("#{quoted_table_name}.#{field} #{like_word} ?", value.mb_chars).first end end end