# Association to indicate synonyms

**URL:** <https://www.ruby-forum.com/t/association-to-indicate-synonyms/129881>\
**Category:** Rails\
**Created:** [February 22, 2008, 10:55am UTC](https://www.ruby-forum.com/t/association-to-indicate-synonyms/129881 "2008-02-22T10:55:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/cc9497/32.png) [@Kless](https://www.ruby-forum.com/u/Kless)\
**Post date:** [February 22, 2008, 10:55am UTC](https://www.ruby-forum.com/t/association-to-indicate-synonyms/129881/1 "2008-02-22T10:55:14Z")

</div>

Which is the better way to indicating synonyms into a table? But I’d  
get all those synonyms together to the main table. Althought if is  
choosed a synonym I’d that it were directed to the object of the main  
table.

I don’t know if a polymorphic association could be helpful in this  
case. Any help please?

* * *

## create\_table :words do |t| t.string :name t.string :synonym # All synonyms of that word, if any (separated by ‘/’) end

## or

create\_table :words do |t|  
t.string :name

has\_many :synonyms  
end

create\_table :synonyms do |t|  
t.string :name

## belong\_to :words end
