sql query in a more "rails 3 way"

Hi people

I want to know if you know how to write the following sql query in a
more "rails way"

UPDATE buy_order_detail
SET saldo = saldo - detail_purchase.cantidad
FROM purchase_detail
           INNER JOIN purchase ON purchase.id =
purchaser_detail.purchase_id
           INNER JOIN waybill ON waybill.id =
purchase.waybill_id
           INNER JOIN buy_order ON buy_order.id =
waybill.order_id
           INNER JOIN buy_order_detail ON buy_order.id =
buy_order_detail.order_id
WHERE purchase_detail.product_id = buy_order_detail.product_id