If I have an active record model say a 'venue' has many 'opening_times'
def edit
@venue = Venue.find(params[:id])
end
In the view I can access this by times=@venue.opening_times
but this is not an array since
times.find_all{|x| false}
returns the all the opening times not zero as would be expected.
however
an_array=times.to_a
an_array.find_all{|x| false}
behaves as expected as does:
an_array=Array.new
times.each{|x| an_array<
http://www.railsweenie.com/forums/5/topics/1306 goes into it in more depth
unlike him however I find that
an_array.method(:find_all).call{|x| x.monday==true}
does work as expected
as does an_array.send(:find_all){|x| x.monday==false}