Created
September 25, 2013 02:04
-
-
Save StephenFiser/6694275 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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