From: Aldric Giacomoni Date: 2009-12-11T01:40:29+09:00 Subject: Re: Fill gaps in Array of Hashes Joao Silva wrote: > I have the following object as a result from MySQL: > > [{:positive=>"0", :neutral=>"2", :total=>"5", :date=>"2009-12-01", > :negative=>"3"}, {:positive=>"3", :neutral=>"3", :total=>"7", > :date=>"2009-12-08", :negative=>"1"}, {:positive=>"1", :neutral=>"1", > :total=>"3", :date=>"2009-12-09", :negative=>"1"}] > > I want to fill gaps (for example from 2009-11-19 till 2010-10-01) with > {:positive=>"0", :neutral=>"0", :total=>"0", :date=>"HEREDATE", > :negative=>"1" - how i can do this in ruby? In MySQL it's impossible to > do :-(. Alright... Now that I've helped you do what you asked for, please tell us what you actually want to do, because actually filling up a hash with default data is really not optimal. -- Posted via http://www.ruby-forum.com/.