This looks like there''s one cart in the session that contains 3 items
(with ref to product)
On 9/21/05, Sergio Bayona
<sergio-SZhfuDltjDxEfCMKe0UOsQC/G2K4zDHf@public.gmane.org>
wrote:> Using the depot example straight out of the Agile book I did
> @session.inspect and it dumped all the data below. Why does it seem to be
> storing all the variables 3 times?
>
>
> #<CGI::Session:0x244827c
@session_id="b4f78284405b8e838b4914823f77dc08",
> @data={:user_id=>nil, :cart=>#<Cart:0x243a564 @total_price=3.0,
> @items=[#<LineItem:0x243a4c4 @new_record=true,
@attributes={"order_id"=>"0",
> "quantity"=>1, "product_id"=>2,
"unit_price"=>3.0},
> @product=#<Product:0x243a1f4
>
@attributes={"image_url"=>"http://www.url.com/image.gif",
"title"=>"product
> 2", "price"=>"3.00",
"date_available"=>"2005-09-21 16:46:00",
"id"=>"2",
> "description"=>"test"}>>]>,
"flash"=>{}},
> @dbprot=[#<CGI::Session::PStore:0x2447c78 @p=#<PStore:0x2445d4c
> @rdonly=false, @transaction=false,
> @filename="/tmp/ruby_sess.38efb51351588e4e", @table=nil,
@abort=false>,
> @hash={:user_id=>nil, :cart=>#<Cart:0x243a564 @total_price=3.0,
> @items=[#<LineItem:0x243a4c4 @new_record=true,
@attributes={"order_id"=>"0",
> "quantity"=>1, "product_id"=>2,
"unit_price"=>3.0},
> @product=#<Product:0x243a1f4
>
@attributes={"image_url"=>"http://www.url.com/image.gif",
"title"=>"product
> 2", "price"=>"3.00",
"date_available"=>"2005-09-21 16:46:00",
"id"=>"2",
> "description"=>"test"}>>]>,
"flash"=>{}}>],
> @dbman=#<CGI::Session::PStore:0x2447c78 @p=#<PStore:0x2445d4c
@rdonly=false,
> @transaction=false, @filename="/tmp/ruby_sess.38efb51351588e4e",
@table=nil,
> @abort=false>, @hash={:user_id=>nil, :cart=>#<Cart:0x243a564
> @total_price=3.0, @items=[#<LineItem:0x243a4c4 @new_record=true,
> @attributes={"order_id"=>"0",
"quantity"=>1, "product_id"=>2,
> "unit_price"=>3.0}, @product=#<Product:0x243a1f4
>
@attributes={"image_url"=>"http://www.url.com/image.gif",
"title"=>"product
> 2", "price"=>"3.00",
"date_available"=>"2005-09-21 16:46:00",
"id"=>"2",
> "description"=>"test"}>>]>,
"flash"=>{}}>, @new_session=false>
>
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>