Another core Rails question:
I have a database table that should contain links to two different records of a particular data type.
Hypothetical example: I am creating a video game database. I have a table for "companies". I want to have exactly one developer and exactly one publisher for each Videogame record.
I know that if I want to have one company, I can just do something like:
script/generate Videogame company:references
But I need to have both companies. I would prefer not to use the connection table, since there can only be exactly two of this data type, and I need them to be different.
It seems that the answer should be pretty obvious, but I can't find it anywhere on the Internet.
ruby ruby-on-rails activerecord scaffolding
Adam Rezich Jan 06 '09 at 16:59 2009-01-06 16:59
source share