-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Model.update() converts object keys passed in set() from attributes name to SQL columnName #7165
Comments
@himankpathak Thanks for posting! We'll take a look as soon as possible. In the mean time, there are a few ways you can help speed things along:
Please remember: never post in a public forum if you believe you've found a genuine security vulnerability. Instead, disclose it responsibly. For help with questions about Sails, click here. |
Hey @himankpathak, I wasn't able to reproduce this behavior you're seeing. Would you be willing to create a github repo with a minimal sails app that reproduces this issue? |
Hey @eashaw , Migrations for the app are mentioned in Readme. Output:
|
Hi @himankpathak, To get the updated value, you can set a variable using model.update() e.g., You can read more about |
Hey @eashaw, It does make sense to use |
Hi @himankpathak, I was looking at this with @mikermcneil. We realized that there was a gap in the upgrade guide here. Here's some background on why this is happening:
Are you seeing this behavior on |
Thanks @eashaw for providing the background on this issue. |
Node version: 16.6.1
Sails version (sails): 1.4.4
ORM hook version (sails-hook-orm): 2.1.1
Sockets hook version (sails-hook-sockets): 1.5.5
Organics hook version (sails-hook-organics): NA
Grunt hook version (sails-hook-grunt): 1.0.8
Uploads hook version (sails-hook-uploads): NA
DB adapter & version : sails-postgresql@2.0.0
Skipper adapter & version : skipper@0.9.0
Issue
When calling Model.update().set(), sails waterline is modifying the object which is passed to the set function.
Camel case keys are attribute names in the sails model and in SQL the column names are in snake case.
Camel case is converted to snake case after the update call.
The text was updated successfully, but these errors were encountered: