-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ActiveModelSerializer doesn't properly translate the error keys for associations #2600
Comments
I debug this with @piotrpalek and it turned out that the |
I'm reopening since it seems like there is an inconsistency between what Rails AMS is sending and what ED expects. @steveklabnik I was not able to find out clearly what AMS is doing about serializing the errors hash, is this something it cares about ? |
AMS is undergoing some amount of re-write, and I'm not the primary maintainer anymore. which version of AMS is involved? |
It's on 0.9-stable. Maybe I can directly ping the primary maintainer ? |
So here's the deal: 0.8 is encouraged as the primary version, 0.9 is getting bugfixes but isn't encouraged. @kurko is working on 0.10, which is based on 0.8, and is the road forward. |
Wow, good to know, thank you. |
@sly7-7 any thoughts on this, what could be the solution? |
@piotrpalek To be honest, I don't know. Actually there is a bug, or at least Rails AMS and Ember-Data AMS are inconsistent. Before doing anything, I'd like to know where the truth is. |
This is currently still an issue with AMS and DS.Errors, the above reference PR #2601 still fixes it too. Any idea why that was closed without a merge? |
Given Ember has an adapter for AMS, I believe the truth is likely to be AMS. IMO Ember should then conform to it. I don't use 0.9 so I don't really have enough info to help, but I'd suggest fixing this on the Ember side with the #2601 PR mentioned above. |
@pangratz Thanks a lot, I'm closing it. @piotrpalek @tonycoco It would be great if you could confirm this issue is gone. |
Hey, so I've come across this weird issue, where I had an
offerCategory
property (relationship) on my model, and when I saved it, and the server responded with 422 it didn't populate the modelserrors
property with the corresponding error.As far as I've checked the response should be good, so I changed the property name to
offer_category
and suddently the errors were populated.I think I've found the bug and fixed a test which was supposed to test this case, but wasn't actually testing it (I think..). Link here: piotrpalek@15381f9.
The text was updated successfully, but these errors were encountered: