use rails for validations