# Adding hashes to array: bad value

**URL:** <https://www.ruby-forum.com/t/adding-hashes-to-array-bad-value/174506>\
**Category:** Rails\
**Created:** [August 27, 2009, 8:50pm UTC](https://www.ruby-forum.com/t/adding-hashes-to-array-bad-value/174506 "2009-08-27T20:50:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aldoitalo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@aldoitalo](https://www.ruby-forum.com/u/aldoitalo)\
**Post date:** [August 27, 2009, 8:50pm UTC](https://www.ruby-forum.com/t/adding-hashes-to-array-bad-value/174506/1 "2009-08-27T20:50:40Z")

</div>

hi,  
i want to implemnt a system for display recurrent events,  
i startly with a embrional code:

######### on my DB i have 1 record:

{ :title =\> “example”, :repeat\_day =\> “4” }

######### on my controller:  
@repetitions = Recurrent.find(:all)

######### on my view:

@new\_object = []  
start\_date = “2009-08-10”.to\_date  
end\_date = “2009-08-30”.to\_date

for repetition in @repetitions  
range\_recurrent =[]  
(start\_date…end\_date).select do |d|  
range\_recurrent \<\< d if repetition.repeat\_day == d.wday  
end

range\_recurrent.each do |r|  
repetition[:time\_to] = r  
@new\_object \<\< repetition  
end  
end

#display all values of @new\_object  
@new\_object.each do |r|  
concat r.title + " - "+ r.time\_to.to\_s “  
”  
end

the problem is the script return:

example - 26-8-2009  
example - 26-8-2009  
example - 26-8-2009

instead of

example - 12-8-2009  
example - 19-8-2009  
example - 26-8-2009

what causes this?
