Associations are a set of macro-like class methods for tying objects together through foreign keys. They express relationships like “Project has one Project Manager” or “Project belongs to a Portfolio”. Each macro adds a number of methods to the class which are specialized according to the collection or association symbol and the options hash. It works much the same was as Ruby’s own attr methods.
has_one, has_many, and belongs_to.has_and_belongs_to_many*.Q: Is there any way to create associations using multi-column primary keys in PostgreSQL?_
A: Rails only recognized one field for a primary key. Maybe you can use a pg View to work around this?
Thanks very much, that works quite well.
Associations are a set of macro-like class methods for tying objects together through foreign keys. They express relationships like “Project has one Project Manager” or “Project belongs to a Portfolio”. Each macro adds a number of methods to the class which are specialized according to the collection or association symbol and the options hash. It works much the same was as Ruby’s own attr methods.
has_one, has_many, and belongs_to.has_and_belongs_to_many*.Q: Is there any way to create associations using multi-column primary keys in PostgreSQL?_
A: Rails only recognized one field for a primary key. Maybe you can use a pg View to work around this?
Thanks very much, that works quite well.