-
Notifications
You must be signed in to change notification settings - Fork 55
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
Can you only updateProperties per model? #258
Comments
You can use the static https://github.com/geddy/model/blob/master/lib/index.js#L504 |
Whoah! That's fantastic! I can't believe I hadn't seen this. |
Is this not documented? I thought it was. |
Delete does the same thing. |
I haven't seen it in any docs, and I did a brief additional scan. |
I remember a bunch of back-and-forth about this before with delete, probably because it's not documented. |
This'll be easy to document. I say leave this open or another issue to document those, it's a nice easy one for anyone to contribute. I'd do it now but I'm craaaazy swamped. |
Took some digging but I finally got it to work. I feel like I'm doing it wrong tho. To get this to work I noticed in the code the
If you don't pass this you get an error (because of this line: https://github.com/geddy/model/blob/master/lib/adapters/sql/base.js#L132). |
Weird, and seemingly a bug. It should already know what its type is. |
Ah, that assumes you're using an actual instance for the data object, which was the original use -- you can also arrive at the |
If I want to update a bunch of models (like getting them from
.all()
) can I do it with updateProperties? That doesn't seem to work.The text was updated successfully, but these errors were encountered: