Add `validate!` method which raises an exception if the record is invalid