X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=app%2Fmodels%2Fcart.rb;h=bd51c383311d6a0a008208a3908955e330be963a;hb=c445da2b4dc5097fcfddf5e40d74c2965573fc1c;hp=88061d380470188dcf6991dcd5e0cdb3f966799d;hpb=aff195f08c5fc2b8db74058b34720164148cfb4e;p=depot.git

diff --git a/app/models/cart.rb b/app/models/cart.rb
index 88061d3..bd51c38 100644
--- a/app/models/cart.rb
+++ b/app/models/cart.rb
@@ -20,4 +20,8 @@ class Cart
     @items.sum {|item| item.price}
   end
   
+  def total_items
+    @items.sum {|item| item.quantity}
+  end
+  
 end