I have a users table and a gifts table. Users can pick gifts for their friends. I am thinking of creating a table to store user id and gift id to track which user picked which gift for whom. How to model this relation? I think users and gifts have a HABTM relation. Is that right?
Share
Try this:
Now following calls are possible:
Make sure you index the
user_id,friend_id,gift_idcolumns inuser_giftstable.