ruby - Rails exists? Case insensitive -
model.exists?("lower(email) = ?", params[:email].downcase)
returns error: argumenterror (wrong number of arguments (2 0..1)):
is possible exists?
case insensitive match?
all need this:
model.exists?(["lower(email) = ?", params[:email].downcase])
it's looking single argument you're providing two. using array form , find-style conditional should need.
Comments
Post a Comment