could some one point me to the right direction:
I try to build a model for rails that build up the following:
ClassA -id
ClassA has a relation to
If it doesn't make too much sense to create another class to join the two, an alternative approach could be:
class Word < ActiveRecord::Base
has_and_belongs_to_many :synonyms, class_name: "Word",
join_table: "word_synonyms",
association_foreign_key: "synonym_id"
end
The join table would look like this:
create_table :word_synonyms do |t|
t.integer :word_id
t.integer :synonym_id
end