Displaying 1 result from an estimated 1 matches for "home_team_cod".
Did you mean:
home_team_code
2008 Dec 13
3
how to do "special queries" ala The Rails Way on "associated" conditions?
...t; :player_stats
def visitor_stats
stats = []
player_stats.each do |stat|
stats << stat if stat.player.team.team_code ==
self.visiting_team_code
end
stats
end
def home_stats
stats = []
player_stats.each do |stat|
stats << stat if stat.player.team.team_code == self.home_team_code
end
stats
end
end
I understand that this isn''t the most efficient or elegant way to do
things. I gleaned this most recently from the posting at (see his
Case 3):
http://www.therailsway.com/tags/has_many
So, I would like to do something like the following, but I''m having...