David made three lines of Moabites, killed two, made slaves of one
Had David's grandmother Ruth been a Moabitess, then both David and Ruth would have been in one of these three lines:
2 Samuel 8:2 And he struck Moab, and measured them with a line; making them to lie down on the ground. And he measured two lines to cause them to died, and one full line to keep alive. And the Moabites were slaves to David, bearers of a gift.
2 Samuel 8:2 And he smote Moab, and measured them with a line, casting them down to the ground; even with two lines measured he to put to death, and with one full line to keep alive. And [so] the Moabites became David's servants, [and] brought gifts.