Lucid Model pivotForeignKey doesn't auto convert to snake_case when set as camelCase as per the docs #4678
Unanswered
muhammedspacesshared
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In the docs here theres this example of how to set a many to many relationship in the models:
https://lucid.adonisjs.com/docs/relationships#manytomany
This follows with the following note:
For foreignKey we can set camelCase and it auto converts to snake_case like the following:
However for pivotForeignKey and the pivotTake examples camelCase doesnt seem to work and we have to set it in snake_case?
So another example when set in snake case it works fine
Calling the following to set a new user role works fine
The following with camelCase does not work
Results in the following error:
Are we missing something or is this a potential bug with it auto converting camelCase to snake_case like in the hasOne example with foreignKey?
Beta Was this translation helpful? Give feedback.
All reactions