hi there,
i got to tables "teams" and "matches".
create_table :teams do |t|
t.string :name
t.timestamps
end
create_table :matches do |t|
t.datetime :kickoff
t.timestamps
end
i have to reference two teams (home & away) in the matches table. but
i dont know how to do it.
when i do something like this:
t.column 'home_team_id', :integer
t.column 'away_team_id', :integer
then i loose the association to the teams-table.
anyone with a tip for me? any help is highly appreciated.