Pluralization of relationships
I've got a relationship where:
{
families: [
{ id: 1, name: 'Stevens' }
],
users: [
{ id: 1, name: 'Jon', familyId: 1 }
]
}
This doesn't work because of the pluralization of the word families. users would need to have familieId: 1 for this to work. Is there a way to map or customize this?
It's a bug. The project is using https://github.com/geetarista/underscore.inflections especially for this case. But somehow, this feature must have been lost in refactoring.
It's still used though to clean orphans (for examples, if family 1 is deleted, users 1 should be too)
I'll fix that.
PS: nice avatar :)
Awesome, good to know.
I was thinking I could get around it by calling my families property familys and then adding a redirect for the route:
server.use('/families/:id', function (req, res) {
res.redirect('/familys/' + req.params.id)
});
BTW Thanks for the awesome work, you just saved me a huge amount of time. I'm using this to setup a mock service layer for my project. :hammer:
You're welcome. I'm very happy if my projects can help :)
Just released v0.7.9 with the fix. It should be good now.
Closing, feel free to reopen/add if you see other problems.