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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - How can I echo out this array? -

javascript - IE11 incompatibility with jQuery's 'readonly'? -