Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
member_model:
class Member < ActiveRecord::Base
has_many :teammembers
has_many :teams, :through => :teammembers
end
=========================
team_model:
class Team < ActiveRecord::Base
has_many :teammembers
has_many :members, :through => :teammembers
end
=========================
teammembers_model:
class TeamMembers < ActiveRecord::Base
belongs_to :member
belongs_to :team
end
=========================
Trying to get:
Member.all(:include => :team)
Error:
Association named 'team' was not found; perhaps you misspelled it?

My Pleasure to write you,
My name is Favor Williams,
My email address is
( Favor24@live.com)
Am interested to know
more about you,
Contact me for my
photo and other
important issue via,

Favor24@live.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment