Datamapper icon indicating copy to clipboard operation
Datamapper copied to clipboard

Better relationship definition and validation

Open WanWizard opened this issue 12 years ago • 0 comments

In Datamapper v1.x a relationship definition is required in both models participating in the relation, because depending on the query constructed either one can be used, and in some cases information from both is needed.

Datamapper v2.x needs a new relationship definition system where this is no longer needed, you should be able to define only one side if you never need to access it from the other side.

Also, to eliminate all the current "guessing" code, a relationship definition should contain all information needed to construct the relation, including the name, the destination model class, the relationship type, possiblt through model information, and the location of primary and foreign keys.

WanWizard avatar Jul 23 '12 09:07 WanWizard