Support compound keys in relationships

Description

(This may already exist and I just don't know about it, but I don't think it's in the docs...)

If a relationship has a compound key, right now you can get it if you do something like this, where a Rating maps to a registration by childID and seasonID:

This is really cool.

The only drawback is that it requires that the whole object is loaded before the relationship can be got, which means you can't eager load a relationship this way. I can't remember how exactly it fails - whether it just uses the seasonID from the first entity or just doesn't construct the query correctly – but it makes sense that it fails since eager loading works off the relationship attributes and the relationship doesn't know that there is more than one key.

Status

Assignee

Unassigned

Reporter

Samuel W. Knowlton

Labels

None

Priority

Major
Configure