
61 Cal.App.2d 505 (1943)
REDWOOD FIBRE PRODUCTS COMPANY, INC. (a Corporation), Appellant,
v.
MILLER MANUFACTURING COMPANY (a Corporation) et al., Respondents.
Civ. No. 12408. 
California Court of Appeals. First Dist., Div. One  
Nov. 29, 1943.
 A. Don Duncan for Appellant.
 Nathan B. McVay for Respondents.
 KNIGHT, J.
 Plaintiff appeals from an order dissolving an attachment levied on a small bank deposit and the undisclosed contents of a safe deposit box.
 The writ was issued in an action to recover several sums of money, aggregating $8,782.80, claimed to be due plaintiff on account of the alleged breach of a contract of warranty involving the manufacture and sale by defendants of two *507 mills or machines designed to grind and shred redwood bark. Under the terms of the contract as pleaded defendants expressly agreed that in the event of a breach of the warranty they would repay to plaintiff the cost of the mills, and one of the sums sought to be recovered, to wit, $1,339, represents such cost. The other sums represent items of damage plaintiff claims to have sustained as the result of the alleged breach. The motion to dissolve the attachment was made and granted upon the sole ground that it appeared from the complaint that the action "is one in tort for damages and not on contract," and therefore does not fall within the scope of that part of subdivision 1 of section 537 of the Code of Civil Procedure which provides that a plaintiff may have the property of the defendant attached "1. In an action upon a contract, express or implied, for the direct payment of money. ..." The single issue to be determined by the appeal is therefore whether the construction so placed by the trial court upon the cause of action pleaded is sustained by the allegations of the complaint; and in considering and determining that issue it must be presumed that such allegations are true.
 The essential facts alleged are as follows: For some time prior to March 5, 1941, plaintiff had been preparing to engage in the business of grinding and shredding redwood bark into bark wool, which it intended to place upon the market and sell for insulation purposes; but in order to do so profitably it was necessary to have two mills built which would be capable of turning out a minimum of 30 tons of bark wool each week. The defendant company operated a manufacturing plant in Modesto where it built grinding mills and machines of different types, and on March 5, 1941, as the result of negotiations between the officers of the two companies, which extended over a period of about three weeks, the defendant "assured and warranted to plaintiff," so the complaint alleges, "that said defendant could and would build and manufacture two mills for the plaintiff, which would be in all respects fit and proper and suitable for the aforesaid purposes, and would do the aforesaid work satisfactorily and in the required volume, to-wit, that said mills would produce a minimum of at least one car, or 15 tons per week of the finished product, per machine, or a total of 30 tons per week, for a total price for the two machines of Fourteen Hundred ($1400.00) Dollars, plus sales tax; and *508 the said defendant then and there offered to plaintiff to build and manufacture said two mills within thirty days and deliver them to plaintiff's plant at Santa Cruz, California, for said price; and then and there said defendant assured and warranted to plaintiff that if said mills would not do the aforesaid work satisfactorily, that defendant would make them do the work satisfactorily, without any expense, in this connection, to plaintiff, or that in the event said machines should not do the aforesaid work satisfactorily, that the cost of the said mills would be paid by said defendant to plaintiff." (Italics ours.)
 Continuing, the complaint alleges "that on or about the 7th day of March, 1941, the said offer and warranty was confirmed by defendant to plaintiff in writing. That on or about March 10, 1941, the plaintiff transmitted to defendant a written acceptance of the said offer and warranty and accompanied same with a down payment, or deposit of $300.00, as agreed"; that "on or about April 23, 1941, the said mills were delivered by defendant to plaintiff's plant and coincident therewith, plaintiff paid to defendant the balance in full of the purchase price of said mills with sales tax."
 The complaint then goes on to allege that the mills were installed under the supervision of defendant's mechanics and factory superintendent, and were set in operation about May 9, 1941, but that they "were never able to do the said required work"; that from May 9, 1941, up to October 1, 1941, defendant's employees were "continually experimenting and tinkering with said mills" in an endeavor to make them do the required work, and that during that period defendant assured plaintiff that it would make them do the work and "would remedy all defects and deficiencies in said mills at its own expense"; "that on or about August 15, 1941, one of said mills became a complete wreck through its improper construction and unfitness for the required purpose, and said defendant offered to fix same at its own expense if it was returned to said defendant's factory at Modesto, but after same was so returned by plaintiff, and on or about September 18, 1941, said defendant notified plaintiff that said mill would not be returned at all except upon the condition that plaintiff pay an additional sum of $185.00 for repairing said mill, upon receipt of the mill; which demand was in express violation of said defendant's aforesaid assurances and warranty. That on or about September 20, 1941, plaintiff *509 notified said defendant that said machines would not and could not do the aforesaid required work, and that said demanded charge for repairing said wrecked mill was improper and in violation of the aforesaid assurances and warranty, and that if said demanded charge was not withdrawn that plaintiff would return both mills. That said charge was never withdrawn. That on October 1, 1941, on account of the total inability of the said machines to do the aforesaid required work, and on account of the aforesaid failure and refusal of the said defendant to make any further repairs or changes in said machines without charging the plaintiff therefor, and on account of the aforesaid refusal and failure of said defendant to return the mill in its possession except upon condition of plaintiff's paying the demanded charge for repairing said machine, to wit, on account of the aforesaid breaches of defendant's assurances and warranty, plaintiff was forced to abandon any further attempts to make said machines do the required work, and any further expenses in trying to make them work, and was forced to purchase other machinery to do the aforesaid required work, and so notified said defendant on said date of October 1, 1941. ... That neither of the said mills was able to do the required work at all under the normal conditions of the business as known to the defendant, for more than an average continuous run of one-half hour at a time, before a major breakdown would occur, nor for more than a maximum continuous period of operation of four hours, on one occasion, on which occasion that mill completely wrecked itself. That the said mills were not constructed properly by defendant to do the required work. That the said machinery was never able to grind or shred the redwood bark as required, or as warranted, or properly or suitably, nor were they ever able to turn out the produce satisfactorily, or in any volume. That the total finished product turned out by said machines within the entire period from May 9, 1941, to October 1, 1941, was and is negligible. That the aforesaid mills were and are, and each of them were and are, worthless and of no value whatever for the uses and purposes aforesaid, for which defendant made and sold them to, and warranted them to plaintiff, and that the consideration for the payment for said machines has wholly failed."
 The remainder of the complaint is devoted to allegations of elements of damage plaintiff claims to have sustained as *510 the result of the alleged breach of warranty, the largest item being for $5,200 for loss of profits, "less profit on 12 tons sold, $120.00." The other items, aggregating $2,363.80, consist of cost of labor, welding, drayage, "handling charges," repairs and telephone calls and cost of various trips to Modesto.
 [1] We are of the opinion that under the terms of the contract as pleaded plaintiff was entitled to an attachment. All that is required by the provisions of the code section authorizing an attachment is that the action be one based on a contract calling for the payment of money, the word "direct" as used in said provision being deemed surplusage (McCall v. Superior Court, 1 Cal.2d 527 [36 P.2d 642, 95 A.L.R. 1019]); and in the present case, as will be noted, the contract as pleaded embodies an express promise on the part of defendant to pay to plaintiff a specific sum of money, to wit, the purchase price of the mills, in the event of a breach of the contract of warranty.
 [2] The fact that the action arose out of the alleged breach of a contract of sale does not take it out of the operation of the attachment statute, for as said in Force v. Hart, 205 Cal. 670 [272 P. 583], it is a well recognized rule of law in this state that an attachment will lie upon a cause of action for breach of contract where the damages are readily ascertainable by reference to the contract, and the basis of computation of damages appears to be reasonable and definite (citing Hale Bros. v. Milliken, 142 Cal. 134 [75 P. 653]; Hamburger v. Halpern, 28 Cal.App. 317 [152 P. 61]; 3 Cal.Jur. 423; see also Donnelly v. Strueven, 63 Cal. 182; Greenebaum v. Smith, 51 Cal.App. 692 [197 P. 675]). Here, admittedly, the amount of the purchase price, which is one of the sums plaintiff seeks to recover, is readily ascertainable, by mere reference to the contract. [3] Plaintiff was therefore entitled to an attachment notwithstanding that it united in its complaint a cause of action for the recovery of other sums of money as damages for the breach of the contract, which if sued for alone would not entitle plaintiff to an attachment. (Force v. Hart, supra; Hamilton v. Baker-Hansen Mfg. Co., 176 Cal. 569 [169 P. 238]; Baldwin v. Napa etc. Wine Co., 137 Cal. 646 [70 P. 732].) The rule in this regard is stated in 3 California Jurisprudence at page 424 as follows: "It is immaterial that plaintiff has also demanded in the complaint other sums which are not liquidated. Section *511 427 of the Code of Civil Procedure authorizes a plaintiff to unite in his complaint several causes of action, where they all arise out of contracts; and under this section he may unite with a cause of action upon a contract for the direct payment of money another cause of action arising out of contract wherein the damages for its breach are unliquidated, and for which he is not entitled to a writ of attachment." [4] Furthermore it is immaterial that the express promise to repay the purchase price was made conditional, since it positively appears from the allegations of the complaint that prior to the commencement of the action there was an actual default in the performance of the condition. The basis for the rule in such cases is that upon actual default of the condition the liability for the payment of money is no longer contingent and the obligation to pay becomes a debt within the meaning of the attachment statute. (See note, 65 A.L.R. p. 1440; also 4 Am.Jur. 627.)
 The position taken by defendant in support of the order granting the motion is summarized in the concluding paragraph of their brief. In substance it is this: that under the contract as pleaded defendant "did not contract to pay money, but rather to build and deliver two mills; therefore, there was no express contract to pay money." They then go on to say that "If an attachment should lie it would be on the theory that there was an implied contract on the part of the defendant to repay the purchase price"; that such implied contract does not arise unless there has been a total failure of consideration, and that the complaint herein "shows that there was not a total failure of consideration, in that the mills were actually delivered and used."
 [5] It is well settled that when a sum of money has been paid pursuant to the terms of a sales contract and the consideration for the sale has entirely failed, the law will imply a promise on the part of the vendor to repay the money; and in such case an attachment will lie. (McCall v. Superior Court, supra; Bennett v. Superior Court, 218 Cal. 153 [21 P.2d 946]; Hamilton v. Baker-Hansen Mfg. Co., supra; S. C. V. Peat Fuel Co. v. Tuck, 53 Cal. 304; 3 Cal.Jur. 424.) And in this connection it should be here stated that on this appeal plaintiff seeks to invoke the application of the above doctrine as an additional ground for the reversal of the order. In fact both parties have devoted a considerable portion *512 of their briefs to a discussion of the question of whether the allegations of the complaint are sufficient to show a total failure of consideration. However, since the contract as pleaded embodies an express promise for the repayment of the purchase price, for which plaintiff is entitled to an attachment, it becomes unnecessary to inquire into the alternative question as to whether the facts alleged are sufficient to give rise to an implied promise for the repayment thereof. [6] Defendant points out that the attachment herein was issued pursuant to an affidavit in which it was averred that all sums of money sued for were due upon an implied contract for the payment of money; but as held in Hamilton v. Baker-Hansen Mfg. Co., supra, the statement in the affidavit for the attachment that the money is due upon an implied contract, when in fact it is due upon an express contract, does not affect the validity of the attachment.
 In support of its main contention that plaintiff was not entitled to an attachment defendant relies largely on the case of Willett & Burr v. Albert, 181 Cal. 652 [185 P. 976], but an examination of the opinion in that case shows that the contract there sued upon was essentially different in its terms from the one here pleaded in that there the contract contained no express promise on the part of the vendor to repay the purchase price or to pay any other sum of money. In this respect the court said: "... the action in fact is not brought for a recovery of the purchase price, or any part thereof, but is strictly for damages for a breach of contract"; and later on the court said: "... it is plain in the present case that there is no express contract for the direct payment of money. ..."
 [7] Defendant further contends that the complaint fails to allege a rescission of the contract and that consequently an attachment will not lie on the theory of an express promise for the repayment of the purchase price. It is an established rule, however, that a motion to discharge an attachment cannot serve as a demurrer if the defect in the complaint can be cured by an amendment (Force v. Hart, supra, citing Hathaway v. Davis, 33 Cal. 161; Hammond v. Starr, 79 Cal. 556 [21 P. 971]; Kohler v. Agassiz, 99 Cal. 9 [33 P. 741]); and in the present case, while it would appear that a rescission may have been imperfectly pleaded, it is quite evident that sufficient facts have been alleged to meet the requirements of section 1789 of the Civil Code which defines *513 the remedies of a buyer for breach of warranty. The pertinent portions of that section provide as follows: "(1) Where there is a breach of warranty by the seller, the buyer may, at his election: ... (d) Rescind the contract to sell or the sale and refuse to receive the goods, or if the goods have already been received, return them or offer to return them to the seller and recover the price or any part thereof which has been paid. ... (3) Where the goods have been delivered to the buyer, he cannot rescind the sale if he knew of the breach of warranty when he accepted the goods, or if he fails to notify the seller within a reasonable time of the election to rescind, or if he fails to return or to offer to return the goods to the seller in substantially as good condition as they were in at the time the property was transferred to the buyer. ... (4) Where the buyer is entitled to rescind the sale and elects to do so, the buyer shall cease to be liable for the price upon returning or offering to return the goods. If the price or any part thereof has already been paid, the seller shall be liable to repay so much thereof as has been paid, concurrently with the return of the goods, or immediately after an offer to return the goods in exchange for repayment of the price. (5) Where the buyer is entitled to rescind the sale and elects to do so, if the seller refuses to accept an offer of the buyer to return the goods, the buyer shall thereafter be deemed to hold the goods as bailee for the seller, but subject to a lien to secure the repayment of any portion of the price which has been paid. ..." (Italics ours.)
 Here the facts alleged show that one of the mills had already been returned to defendants, and that on or about September 20, 1941, plaintiff notified defendants that the "machines would not and could not do the aforesaid required work"; that on October 1, 1941, "on account of the total inability of the said machines to do the aforesaid required work ... and ... on account of the aforesaid breaches of defendant's assurances and warranty, plaintiff was forced to abandon any further attempts to make said machines do the required work ... and was forced to purchase other machinery to do the aforesaid required work, and so notified said defendant on said date of October 1, 1941. ..." (Italics ours.) And while it does not appear from the allegations of the complaint that a formal notice of rescission was ever served upon defendant, it does sufficiently appear in our opinion from the *514 other allegations that there was an offer to return the second mill. As said in the case of Mahony v. Standard Gas Engine Co., 187 Cal. 399 [202 P. 146], "... plaintiff could not have done more, except, possibly, to have said, which would have added nothing to the efficiency of the rescission, 'I rescind the contract existing between us.'"
 For the reasons hereinabove stated, the order dissolving the attachment is reversed.
 Peters, P. J., and Ward, J., concurred.
