A married woman may sue and be sued as if she were unmarried, and her husband may be joined with her only when the cause of action is in favor of or against both.