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

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -