Sha256: b0c66f94a70fe00f1b9326966ddf03d792ad72f25403888394b77ec2ba671024

Contents?: true

Size: 484 Bytes

Versions: 11

Compression:

Stored size: 484 Bytes

Contents

module SportDb
  module 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 Model
end # module SportDb

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
sportdb-1.8.17 lib/sportdb/models/group.rb
sportdb-1.8.16 lib/sportdb/models/group.rb
sportdb-1.8.15 lib/sportdb/models/group.rb
sportdb-1.8.14 lib/sportdb/models/group.rb
sportdb-1.8.13 lib/sportdb/models/group.rb
sportdb-1.8.12 lib/sportdb/models/group.rb
sportdb-1.8.11 lib/sportdb/models/group.rb
sportdb-1.8.10 lib/sportdb/models/group.rb
sportdb-1.8.9 lib/sportdb/models/group.rb
sportdb-1.8.8 lib/sportdb/models/group.rb
sportdb-1.8.7 lib/sportdb/models/group.rb