activerecord - How to compare null in rails active record query -
how can match null in rails active record.
user.where(['id = ? , active = ? , activation_code = ?', params[:id], 0, null]).first
or
user.where(['id = ? , active = ? , activation_code = ?', params[:id], 0, nil]).first
both not working.
try this:
user.where(['id = ? , active = ? , activation_code null', params[:id], 0]).first
Comments
Post a Comment