Re: [Rails] Iterate over a set of classes

2014-04-11 Thread Colin Law
On 10 April 2014 22:20, Jan Yo li...@ruby-forum.com wrote: I have class A and B. A has many Bs. B has a field is_visible which can be true or false I have alot of As as well I can acquire a set of As by doing the follwoing: @As = X.find_by... Need to iterate over all the As, and return

[Rails] Iterate over a set of classes

2014-04-10 Thread Jan Yo
I have class A and B. A has many Bs. B has a field is_visible which can be true or false I have alot of As as well I can acquire a set of As by doing the follwoing: @As = X.find_by... Need to iterate over all the As, and return each B where B.is_visble is true. since we are going across all