media_lender question..

0 views
Skip to first unread message

Chris Sund

unread,
Nov 19, 2009, 12:27:01 PM11/19/09
to Utah Ruby Users Group
Hey Group,

I'm hoping someone can lend their expertise to my question. I'm trying
to re-create a piece of functionality that we used in the media_lender
app this summer. It revolves around that apps ability to send an
invitation to a friend. I'm trying to figure out how the app populates
the "friendships" table with the friend_id and the user_id?

I think it has to do with the "inverse" relationships, but I'm not
sure. I couldn't find any code that actually created a record.

If someone has a moment I would love a brief explanation.

Many Thanks!

Chris

Jenica Jacobsen

unread,
Nov 19, 2009, 1:56:31 PM11/19/09
to ur...@googlegroups.com
I think it has to do with the has_many calls in user.rb and the belongs_to calls in friendship.rb, in the model.  Then activeRecord takes care of adding the join records.  I'm not an expert though :)
Reply all
Reply to author
Forward
0 new messages