High level question, with a “belongs-to” relationship … you
usually put the primary key of the parent object into the table of the
child. I would like to know if there is a way to reference the parent
object, via something else than the primary key. Here is a simple
Class Property “belongs-to” class Neighborhood
Class Neighborhood “has-many” class Properties
Properties Table contains a field called AREA.
Neighborhood Table contains a field called AREA_ID
Property.AREA == Neighborhood.AREA_ID // these two data points match
Can I reference the Neighborhood Object from the Property Object,
without adding the primary key from the Neighborhood table to the
property table? Ideally, I would like to write code like: <%
property.neighborhood.name %>, as I would be able to if I added the
primary Neighborhood id key to the Property table.
Thanks for any insight!