search for: team_code

Displaying 1 result from an estimated 1 matches for "team_code".

Did you mean: dead_code
2008 Dec 13
3
how to do "special queries" ala The Rails Way on "associated" conditions?
I have the following in a model class: class Game < ActiveRecord::Base has_many :player_stats has_many :players, :through => :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 glean...