Made user model an activerecord one
Validations working but flash msg is not