Active Record two belongs_to calls or single table inheritance
- by ethyreal
In linking a sports event to two teams, at first this seemed to make sense:
events
- id:integer
- integer:home_team_id
- integer:away_team_id
teams
- integer:id
- string:name
However I am troubled by how I would link that up in the active record model:
class Event
belongs_to :home_team, :class_name => 'Team', :foreign_key =>…