Re: [Rails] adding key/value pairs to hash wrongfully adds a right bracket

2011-10-23 Thread Dave Aronson
On Mon, Oct 17, 2011 at 17:27, John Merlino stoici...@aol.com wrote: THis line of code gets called multiple times and creates a hash: Before I try to figure it out further, something smells. You pass in an arg called code, and often refer to :code. This sort of shadowing is Very Confusing.

[Rails] adding key/value pairs to hash wrongfully adds a right bracket

2011-10-17 Thread John Merlino
Hey all, THis line of code gets called multiple times and creates a hash: def session_code(unit_id, code) s_code = session[:code] unit_id_hash = s_code.detect {|h| h[unit_id]} if unit_id_hash.nil? unit_id_hash = {} s_code {unit_id = unit_id_hash} end key =