Model.exists?("lower(email) = ?", params[:email].downcase)
Returns an error: ArgumentError (wrong number of arguments (2 for 0..1)):
ArgumentError (wrong number of arguments (2 for 0..1)):
Is it possible to do exists? with a case insensitive match?
exists?
All you have to do is the following:
Model.exists?(["lower(email) = ?", params[:email].downcase])
It looks for one argument, but you provide two. Using an array form and a find-style conditional should get what you need.
You can also do the following:
Model.where("lower(email) = ?",params[:email].downcase).exists?