Configuring joins is needlessly tedious
{
name: '_strategies',
type: 'joinByArray',
idsField: 'strategiesIds',
label: 'Strategies',
withType: 'strategy'
}
My thoughts:
idsFieldshould default to the name of the join, less the_, plusIdsidFieldshould do something similar for joinByOne. Confusing them is common and this eliminates that as an issuelabelshould default to thepluralLabelofwithType(ooooooo)
Now we have:
{
name: '_strategies',
type: 'joinByArray',
withType: 'strategy'
}
So nice
If relationship is present, relationshipsField should also default. If the join is _strategies then the default relationshipsField would be strategiesRelationships.
What do you think?
Generally, I would be very in favor of some smart defaults here.
idsField should default to the name of the join, less the _, plus Ids
_strategiesIds ?
The _ needs to come off because anything with a _ is not stored back to
mongodb at "update/insert" time (except for _id).
This is the convention that permits us to attach dynamically joined stuff to dumb JSON objects and yet still be able to avoid redundantly storing it back to MongoDB.
On Fri, Sep 9, 2016 at 12:25 PM, Alex Gilbert [email protected] wrote:
Generally, I would be very in favor of some smart defaults here.
idsField should default to the name of the join, less the _, plus Ids
_strategiesIds ?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/punkave/apostrophe/issues/652#issuecomment-245964438, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB9fQGMcYEUFWcM1txnVc5lLg1vDyUOks5qoYh8gaJpZM4J5MBb .
*THOMAS BOUTELL, *SUPPORT LEAD P'UNK AVENUE | (215) 755-1330 | punkave.com
See above. This was implemented and merged.