Model.exists?("lower(email) = ?", params[:email].downcase)
Returns error: ArgumentError (wrong number of arguments (2 for 0..1)):
Is it possible to do a exists?
with a case insensitive match?
All you need to do is this:
Model.exists?(["lower(email) = ?", params[:email].downcase])
It's looking for a single argument but you're providing two. Using the array form and the find-style conditional should get what you need.
You also can do like this:
Model.where("lower(email) = ?",params[:email].downcase).exists?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With