has-friendship / has_friendship

Add friendship to ActiveRecord models
MIT License
198 stars 98 forks source link

Polimorfic association is incomplete #14

Open Pensarfeo opened 8 years ago

Pensarfeo commented 8 years ago

The polimorfic association we have right now does not uniquely define a relation. And can bring wrong results. Ex We have two tables: Men, Women When we call find_relation we might find relationships withing Men and Women as well as Men/Men & Women/Women.

sungwoncho commented 8 years ago

Yes. I think a solution would be to make the friend_type column in the friendship table. Currently we only have friend_id. Any thoughts?

sergeyryabov commented 8 years ago

How about using uuid as primary key instead id?

chevinbrown commented 6 years ago

@Pensarfeo should a unique index fix this issue?