is it possible to implement a recursive foreign key association like
that?
i''m writing a vocab app, where i want the vocab table to have an id
and two foreign keys, word1 and word2.
the word table will have an id, a word-string, and a language
i''m trying to do this as follows:
class Vocab < ActiveRecord::Base
belongs_to :word
belongs_to :word
class Word < ActiveRecord::Base
has_many :vocabs
has_many :words, :through => :vocabs
but it doesn''t work. I''m really new to rails and ruby.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---