I can't figure this out...

this is the strangest error...

There is a Game with a Home and Away Team. The game table has hometeam_id and awayteam_id as foreign keys to the team table's id.

game model
Code:
class Game < ActiveRecord::Base
  has_one :hometeam, :class_name => 'Team', :foreign_key => 'hometeam_id'
  has_one :awayteam, :class_name => 'Team', :foreign_key => 'awayteam_id'
end
and in the view
Code:
<%= game.awayteam.class %>
And this gets me:
Code:
#42S22Unknown column 'teams.awayteam_id' in 'where clause': SELECT * FROM teams ... etc
Why is it looking for awayteam_id in teams and not in games? Am I using has_one incorrectly?