Sha256: ceb3c5fe8f36f51f11ad64360b14504b8fe956dc72ac01fdb37442558173968f

Contents?: true

Size: 460 Bytes

Versions: 5

Compression:

Stored size: 460 Bytes

Contents

module SportDb::Model


class Group < ActiveRecord::Base
    
  has_many :games, :order => 'pos'
  belongs_to :event
  
  has_many :group_teams, :class_name => 'GroupTeam'
  has_many :teams, :through => :group_teams
      
  def add_teams_from_ary!( team_keys )
    team_keys.each do |team_key|
      team = Team.find_by_key!( team_key )
      self.teams << team
    end
  end
      
end # class Group
  
  
end # module SportDb::Model

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sportdb-1.8.6 lib/sportdb/models/group.rb
sportdb-1.8.5 lib/sportdb/models/group.rb
sportdb-1.8.3 lib/sportdb/models/group.rb
sportdb-1.8.2 lib/sportdb/models/group.rb
sportdb-1.8.1 lib/sportdb/models/group.rb