Hi Jon, > I would want: > belongs_to :shell_user, :class_name => User, :child_key => > [:friend_id], :nullable => false, :index => true
I've been thinking about making it so that some of the property options can be passed in to has() and belongs_to() for creating the child key properties. However, for the immediate future you'll need to use an explicit property() call, with belongs_to(). > Also, this thing called child_key seems odd. why is it an > array? The :child_key option is an Array because DataMapper doesn't make any assumptions that keys will be only a single property. You can have primary keys that contain 3 properties, or foreign keys that use 2. While we could make it so that if you passed in a single Symbol for :child_key that it was treated as if it were inside an Array, I don't think it's necessary. Consistency is more important than convenience. > Am I still missing something aside from the fact that the guy that > invented rails saddled the ruby word with nomenclature that bucks > against 30 years of relational data modeling? > > Basic data modeling tells me that my relation is a "has 1" not a "belongs to" That's interesting. I've it's common knowledge I assume there should be an abundance of authoritative reference material on this specifically. I was unable to find anything concrete in a few data modeling books I own. I would be really interested to see a rule that states which side of the relationship the FK should be on based on the relationship being defined as "has 1". Would you mind pointing me to some? Dan (dkubb) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/datamapper?hl=en -~----------~----~----~----~------~----~------~--~---
