She-Devil

Ruth is a frumpy, overweight wife and mother, who tries desperately to please her husband Bob, an accountant trying to boost his business. After Bob meets Mary Fisher, a romance novelist, at a dinner party, they begin an affair. Ruth, aware of the affair, confronts Bob while his parents are visiting, and Bob leaves her. As he packs his suitcase, he says his assets are his home, his family, his career, and his freedom. Angry, Ruth vows revenge on him and Mary. Ruth writes a list titled "Bob's Assets", with the four assets that Bob stated. She crosses off each one when it is destroyed. With Bob away at Mary's and the kids at school, she sets the house on fire, which is destroyed in a gigantic explosion. She drops the children off with Bob (now living with Mary) and tells him that she will not be returning. However, she is still working behind the scenes to destroy Bob's remaining assets. It is revealed that Bob's second asset, his family, is being destroyed, too, as Mary's selfish refusal to learn how to be a mother causes tension in her relationship with Bob.
Ruth takes a job at a nursing home under the pseudonym Vesta Rose, where she befriends Mary's foul-mouthed, estranged mother, and arranges for her to return to Mary's life at an inopportune moment. She also meets Nurse Hooper, a woman who has worked for the nursing home for twenty-two years and put aside her earnings for a considerable life savings. They form a partnership and start an employment agency for downtrodden women who have been rejected by society and need a second chance. The agency is a success, and women who Ruth has helped assist her in getting revenge on Bob.
Mary writes a new novel loosely based on her romance with Bob, which her publisher considers strange and off putting, because of its focus on laundry and the protagonists' name, Bob. Olivia, an attractive but ditzy young blonde applies to Ruth's agency, and she finds her a position as Bob's secretary. He soon starts sleeping with her but when she proclaims her love, he immediately dumps and fires her. Olivia reveals to Ruth that Bob is a fraudster who cons money out of his clients. Ruth exposes this to his superiors and the police, thus destroying his career.
Mary's career goes downhill, too. As she is being interviewed for a puff piece by People, her mother reveals embarrassing secrets about Mary that are reported in the article. Bob throws a party for Mary to cheer her up, which goes well until state troopers appear with a warrant for Bob's arrest. Bob's lawyer bribes a judge to ensure the verdict is favorable and unknowingly informs Mary that Bob has been stealing from her account as well. As Mary leaves Bob, he realizes what he did to Ruth has happened to him and he has ended up with nothing because of his greed and infidelity. A woman who gained employment as a court clerk thanks to Ruth's agency, pays Ruth back by reassigning Bob's case to an unbiased judge. Bob is convicted of embezzlement and sent to prison, thus destroying his fourth and final asset, his freedom. Meanwhile, Mary sells her mansion when her novel fails, while Ruth's business thrives.
Ruth and her children visit a greatly reformed Bob, who says he is looking forward to spending more time with Ruth and the children upon release. Ruth ends by saying she believes a person can repent as has Bob, but not everyone, as the final scene shows Ruth at a book signing for Mary's new novel â in which she tells all about her affair. Ruth asks Mary to make the autograph out to Ruth, and Mary does a double take. Next in line after Ruth is a man whom Mary clearly tries to become more personal with, indicating she has not changed her ways. The film ends with Ruth, a smile on her face as she walks down a busy street in Manhattan, accompanied by women from her firm.

Question: Which character in the film had an affair?
Answer: Mary