I found that if a user registers with an email and use a capital letter in their email when I do the following I get nil.
Example:
username = Dillan@example.com
params[:user][:email] = dillan@example.com
user = User.find_by_email(params[:user][:email])
user.nil?
=> true
How can I search for an email without the problems of case sensitivity or how an I write a find_by_email that is case insensitive?