Skip to content

Instantly share code, notes, and snippets.

@StephenFiser
Created September 25, 2013 02:04
Show Gist options
  • Save StephenFiser/6694275 to your computer and use it in GitHub Desktop.
Save StephenFiser/6694275 to your computer and use it in GitHub Desktop.
class Team < ActiveRecord::Base
attr_accessible :name
has_many :presenters
end
class Presenter < ActiveRecord::Base
attr_accessible :name
has_many :reports
belongs_to :team
def team_name
team.name
end
end
class Report < ActiveRecord::Base
attr_accessible :title
belongs_to :presenter
def presenter_team_name
presenter.team_name
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment