validating activerecord model inputs