title: How to add column values in ror
body: <p>I am new in rails.I am building a shopping cart application where an user can add items in the cart.So, i have a table <code>line_items</code> in MySql database where i have two columns(<code>cart_id</code>,<code>quantity</code>).I want to add all the <code>quantities</code> having same <code>cart_id</code>.For example, with <code>cart_id=5</code> i have three quantities(2,4,3).So, how do i add all the quantites, which will give me the result 9.</p>
  
  <p>I can do it in Mysql like :</p>
  
  <p><code>select cart_id,quantity as total_quantity from line_items where cart_id=5</code></p>
  
  <p>But how to do in ROR.</p>