Plaintiff sued a corporation, took its default on a breach of contract claim. Plaintiff also sued the corporation’s owner and a related corporation. After voluntarily dismissing the contract cause of action against those defendants, plaintiff continued to pursue tort claims against them for fraudulent conveyance and conspiracy, attempting to hold them liable on the default judgment against the corporation. The owner and related corporation prevailed against those claims. This decision holds that the owner and related corporation prevailed “on the contract” (between plaintiff and the corporation) since plaintiff had tried to hold them liable on the contract as alter egos. This was true even though the only remaining claims against the owner and related corporation were tort claims. Also, plaintiff’s voluntary dismissal of its contract claim against the owner and related corporation didn’t shield it from liability for attorney fees under Civ. Code 1717(b) since that provision applies only when the entire action is voluntarily dismissed, not when, as in this case, merely one of several claims is voluntarily dismissed.