From: Eugene Bolshakov Date: 2007-09-11T17:35:36+09:00 Subject: Re: CartItem count being 0 or 1 all the time Hi, >> So it seems like with the Depot app in Chapter 8, if there are >> thousands of users using the website, there will be thousands or tens >> of thousands of CartItem objects in the server machine's RAM.... and the >> Cart object contains the array that tells which user has which >> CartItem objects... The Cart object contains the array of current user's items only. >> but I tried adding items after items... the count just won't go from 1 >> to 2, 3, 4, 5, 6 but will just keep on being either 0 or 1. Any >> thoughts as to why? That happens because on every request the Cart class is loaded and @@count is set to 0. Then Cart@initialize is called (only once) and @@count is set to 1. What do you want to achive? Id you'd like to get the total number of items in the current user's cart, then it's simply Cart#items.size, if you'd like to know the total number of items in all users' carts then you need to store it in somewhere (in the database for example) and update on adding/removing the product. Hope that helps. Eugene