Money columns does not exist when using update_all method #675
Unanswered
planetaska
asked this question in
Q&A
Replies: 1 comment
-
|
Using |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
I have a Book model with a
price_centscolumn like this:This Book model is a STI base model for other Book types such as Novel, Comic models.
And I can use other money features just fine. But when I need to mass update the books resource, I run into this issue:
Related code in controller:
Gives this error:
It seems that Rails couldn't find the correct column name when using update_all.
If I change
update_allto justupdate, then the code works as expected.Obviously this is not ideal. So my question is: is there a way to update Money columns with
update_allin a STI relation?Beta Was this translation helpful? Give feedback.
All reactions