Is having both :presence=>true and length validation on my rails model redundant? Or is there a reason to have both?
Is having both :presence=>true and length validation on my rails model redundant? Or is
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Those validations do not do the same.The only difference is that if you just leave the validation checking the length you could still fill the field with spaces (from 1 to 255).
With the presence validation spaces are not taken a character