title: How to use inject to get sum of some AR collection?
body: <p>There is model Order with association OrderItem. I need to calculate order's cost, and I use for it the following code:</p>
  
  <pre><code>order_items.inject{ |sum, oi| sum += oi.value }
  </code></pre>
  
  <p>But as result I get OrderItem object, not Fixnum or something else. What do I wrong?</p>