S
Sijo Kg
Hi
I have
all_req = OnRequest.findall, :conditions => [status_id = ?',6])
Now i need to create an array of size 12 containing record counts for
month January to December like [recordcountjanuary,recordcountfeb,....]
So for the first month january I tried like
all_req.select do |r|
r.created_at.mon == 1
end
What i need is reuse the above code I have placed it in a
function But there I have to call it 12 times .How can i avoid this?
Thanks in advance
Sijo
I have
all_req = OnRequest.findall, :conditions => [status_id = ?',6])
Now i need to create an array of size 12 containing record counts for
month January to December like [recordcountjanuary,recordcountfeb,....]
So for the first month january I tried like
all_req.select do |r|
r.created_at.mon == 1
end
What i need is reuse the above code I have placed it in a
function But there I have to call it 12 times .How can i avoid this?
Thanks in advance
Sijo