Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. id , title , description
  2.  
  3. id , order_id , name , product_id , cost
  4.  
  5. Order_title_1 => 5 (count of order_id )
  6.  
  7. Item.joins(:orders).select("orders.id, orders.title, SUM(items.order_id) as total").group("order_id")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement