search for: home_team

Displaying 7 results from an estimated 7 matches for "home_team".

2009 Jul 29
5
[newbie] double relationships in database
I have the following tables teams id :string name :string and matches id: home_team :team_id visitor_team :team_id how can I reflect that kind of relationship in a RoR model? thanks and keep up the good work.
2007 Oct 16
8
Using multiple foreign keys in views
I have a model, Game, that has_many :teams. There''s a home team and an away team. I created two foreign keys, so each game can have two teams associated with it. Here''s the Team model: class Team < ActiveRecord::Base belongs_to :game, :class_name => ''Game'', :foreign_key => ''hometeam_id'' belongs_to :game, :class_name =>
2006 Mar 07
13
Active Record - Can''t figure out relationship.
...table teams ( id int not null auto_increment, short_name varchar(12) not null, long_name varchar(50) not null, logo varchar(20) not null, primary key (id) ); create table rounds ( id int not null auto_increment, home_team_id int not null, away_team_id int not null, round tinyint(4) not null, home_team_score tinyint(8) not null, away_team_score tinyint(8) not null, constraint fk_home_teams foreign key (home_team_id) references teams(id), constraint fk_away_team...
2007 Jun 09
7
create 2 fk referencing the same table
Hi everyone! I have a problem with defining 2 fk referencing the same table. I have a Program table and a Team table. The Program should have an away team and a home team fk. From my understanding, "the fk column should be named after the class of the target table, converted to lowercase, with _id appended". But, in my case, I have 2 fk referencing the same table. How can I do this?
2006 May 14
3
Strange Database Mapping Question
...al sports available on the internet except this one is for Rugby. The relevant tables in my database are as follows: create table teams ( id INT AUTO_INCREMENT NOT NULL, name VARCHAR(40), PRIMARY_KEY(id) ); create table games ( id INT AUTO_INCREMENT NOT NULL, date DATETIME, #Date of game home_teams_id INT, #id of home team away_teams_id INT, #id of away team home_team_score INT, #this is not meant to link to another table away_team_score INT, #this is not meant to link to another table PRIMARY_KEY (id) ); In this example the home and away team records in games are supposed to link to a...
2004 Aug 07
1
end_modal question
Really stupid question, but have you wrapped this all in an App class? If you don''t have a wxApp subclass driving your applications then all sorts of badness would happen. > I''m writing a custom little application for my boss''s high school > football team to track there stats play by play. > > My problem is that when I start the application, it
2008 Oct 07
6
Hpricot loop question to read table row values
Hi. I''ve got a file that contains a table that looks like this: <table> <tr><td>column title a</td><td>column title b</td></tr> <tr><td>row 1 a</td><td>row 1 b</td></tr> <tr><td>row 2 a</td><td>row 2 b</td></tr> <tr><td>row 3 a</td><td>row 3