Hey so all of the articles I read on this say that if you''re going to
have two belong_to''s to a single table ti should look something like
this
belongs_to :player, :foreign_key => "player_one"
belongs_to :opponent, :class_name => "Player", :foreign_key =>
"player_two"
That seems to work okay and I can access the first "player" on the
view
with object.player.whatever, but I have no idea how to access the second
object.
I thought it would be object.opponent.whatever but that doesn''t work.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.