Fix(crud) include param lookup now works w/plurals #26
No reviewers
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: thereadme/hapi-sequelize-crud#26
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix-include"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Previously, {one,many}-to-many relationships with models would result in
associationNames
that were plural. e.g.Team
might have many playersand one location. The validation was expecting to see the plural
Players
and the singularLocation
but Sequelize is expecting thesingular
Player
(Location
worked fine). This meant that include lookupswould silently fail. This fixes the problem in a backward- compatible way.
It continues to allow
include=Location
(capitalized) for backward-compatibility. And now allows and actually does the lookup for
include=players
,include=player
,include=Player
,include=Players
lookup relationships.
There are also a few small changes that enable the above.
I'm working on a separate PR that adds integration tests so that we can ensure this kind of thing doesn't happen again.
cc @mdibaiee
@joeybaker: Thanks Joey! Looks fine to me 👍
Released as 2.7.1