Active record validations

some codes of Active Record Validations