Skip to content

Instantly share code, notes, and snippets.

@radar
Created September 28, 2008 01:17
Show Gist options
  • Save radar/13385 to your computer and use it in GitHub Desktop.
Save radar/13385 to your computer and use it in GitHub Desktop.
class Game < ActiveRecord::Base
belongs_to :team_1, :class_name => "Team"
belongs_to :team_2, :class_name => "Team"
def name
[team_1, team_2].map { |team| team.city + ' ' + team.name }.join(' vs. ')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment