Could the inclusion of the games records be multiplying the number of teams 
that get returned maybe?  Any difference if you take :games out of that 
:include array there?

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of 
Thierry Delbart
Sent: Friday, October 24, 2008 2:24 PM
To: [email protected]
Subject: [Rails] 'each' loop 2 times trough all records


Hello,

I'm having some troubles today with Ruby...

I do
    @league = League.find(params[:id], :include => [ :teams, :games ])

then
    @league.teams.each do |t|

and it goes 2 times through the teams list ??? even if @league.teams.size = 2.

Does anyone have a clue where it can come from??

Thank you for you help,

Thierry
--
Posted via http://www.ruby-forum.com/.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to