Hello there, I was wondering whether rails 1.1.1 supports N:M:K relationships that is having a pivot table with three columns which are primary keys: say, (apple_id, orange_id, lemon_id) It would be so great if Rails could be able to have id-s which as n-tuples. Thanks, Roland -- Posted via http://www.ruby-forum.com/.
On Tue, Apr 18, 2006 at 09:21:51PM +0200, Roland Mai wrote: } Hello there, } } I was wondering whether rails 1.1.1 supports N:M:K relationships that is } having a pivot table with three columns which are primary keys: } } say, (apple_id, orange_id, lemon_id) } } It would be so great if Rails could be able to have id-s which as } n-tuples. I wouldn''t expect it to ever support n-way relationships directly. You can, however, do this: AOL belongs_to :apple belongs_to :orange belongs_to :lemon Apple has_many :aols Orange has_many :aols Lemon has_many :aols Also, I believe you can use has_many :through to get to the other objects more directly. } Thanks, } Roland --Greg
Maybe Matching Threads
- Rake migrate and creating join tables
- Dovecor 1.2 : Command output: Fatal: Unknown argument: flags=DRhu Usage: deliver [-c <config file>] [-a <address>] [-d <username>] [-p <path>] [-f <envelope sender>] [-m <mailbox>] [-n] [-s] [-e] [-k] )
- n-to-m relationships in Forms
- [R] choose(n, k) as n approaches k
- choose(n, k) for k>n: An inconsistency?