I want to know if you know how to write the following sql query in a
more "rails way"
SET saldo = saldo - detail_purchase.cantidad
INNER JOIN purchase ON purchase.id =
INNER JOIN waybill ON waybill.id =
INNER JOIN buy_order ON buy_order.id =
INNER JOIN buy_order_detail ON buy_order.id =
WHERE purchase_detail.product_id = buy_order_detail.product_id