Forum: Ruby on Rails Active record confusion

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Pratik N. (Guest)
on 2006-01-15 00:52
Hi,

I'm trying to setup an application where users are interconnected.

For example, each user will have multiple friends and each user can be
friend of multiple people. Now, I just have one User table with fields (
id, name, information ). How do I use ActiveRecord in such a way that I
get all friends of a perticular user by giving User.find(1).friends ?

Thanks a lot,
Pratik
Peter M. (Guest)
on 2006-01-15 01:01
(Received via mailing list)
This may be what you are after

http://wiki.rubyonrails.com/rails/pages/HowToCreat...

-Peter
Pratik N. (Guest)
on 2006-01-15 01:33
Thanks a lot Peter ! That what exactly what I was looking for :)

Cheers,
Pratik

Peter M. wrote:
> This may be what you are after
>
> 
http://wiki.rubyonrails.com/rails/pages/HowToCreat...
>
> -Peter
Pratik N. (Guest)
on 2006-01-15 01:34
Thanks a lot Peter ! That's exactly what I was looking for :)

Cheers,
Pratik

Peter M. wrote:
> This may be what you are after
>
> 
http://wiki.rubyonrails.com/rails/pages/HowToCreat...
>
> -Peter
This topic is locked and can not be replied to.