Appellant filed his petition for writ of mandamus against the hoard of supervisors of Cochise county, Arizona, asking that the board be commanded to fix the compensation to he allowed him for services rendered as assistant to the county attorney of Cochise county in prosecuting what were commonly known as the “deportation cases.” It is *473alleged in the petition that, after the rendition of the services, appellant presented his claim against the county in the sum of $1,500, and upon its disallowance by the board brought suit to recover that sum, which suit resulted in a judgment in favor of the county. On appeal to this court, the action of the superior court was affirmed. Worsley v. Cochise County, 22 Ariz. 225, 196 Pac. 419.
From the record we gather that a peremptory writ of mandamus issued to the board of supervisors to fix the compensation of appellant, in accordance with which the board allowed the sum of $375 and made return of such action to the court. The judgment of the court was an approval of such return and a refusal of further action on the petition. The ease is before us on appeal from this judgment.
The contention of appellant is that the general demurrer to the complaint in the former action must be taken to have confessed the truth of the allegations of that complaint, including the allegation that the services were worth $1,500 and that the board is, therefore, now estopped, upon the principle of res judicata and because of its privity with the county, from contesting that averment in this proceeding. From this postulate plaintiff deduces that there was no discretion in the board to allow any other sum and that therefore the court below should have made the writ peremptory compelling the board to fix that amount.
Several sufficient answers to this contention may be made, but we at once address ourselves to the basic proposition advanced. The principle sustained without dissent by the text-books and authorities is that a general. demurrer admits the truth of the allegations of the pleading attacked, for the purpose only of determining their legal effect. Its purpose is, in short, to obtain a ruling of law which will relieve the *474demurrant from going further in answering to an unmeritorious charge or defense, and the court from pursuing a futile inquiry. See Jacobs v. Vaill, 67 Kan. 107, 72 Pac. 530; Scoville v. Seeley, 14 Conn. 239; Havens v. Hartford & New Haven R. Co., 28 Conn. 69; Chambers v. Miller, 9 Tex. 236; 6 Ency. Pl. & Pr. 337; Freeman on Judgments, 4th ed., § 267.
The judgment rendered against the appellant in the former action conclusively established that upon the facts alleged he had no cause of action against Cochise county. On that question, and that alone, is it res judicata. Under the rule as contended for by appellant, no defendant would ever be safe in questioning a complaint by demurrer and taking judgment upon the issues of law ruled in his favor, because by the very act of taking judgment he would thereby admit the existence of the facts well pleaded in the complaint and bind himself by such admission for all subsequent proceedings, whether based upon the cause of action therein attempted to be set forth, or upon some other cause of action.
This disposes of the case, for there is nothing in the record before us, even were we empowered to interfere with the discretion of the board of supervisors, to show that they have abused such discretion.
The action of the lower court was right, and the judgment must be affirmed.
ROSS, C. J., and MoALISTER, J., concur.