-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Embedded association not using serializer #2247 #2367
Comments
@jcpny1 I closed it because it was attracting off-topic conversation and was stale. The resolution IMHO is as follows
|
I have the exact same issue as the linked issue. So I should do this? attributes :child
def child
ChildSerializer.new(object.child)
end instead of this? has_one :child # (also tried adding the :serializer option, didn't work) If that's the case I'd say that defies the developer's expectation communicated by the feature Update changing to the manual example above did work for me, but that really doesn't feel right. Not sure why I would or should use the association methods that I have serializers for. I always want the serializers used. I upgraded from 0.8 so it seems this worked as expected in 0.8? |
@joemsak unless you need to upgrade your version for some feature in 0.10 I recommend you stay on it at this point |
I understand your point, and I think it still would be nice to know what to expect from this feature in the latest version, or to have this issue explained/clarified better. |
@joemsak I apologize but I'm not entirely sure what you're asking. I believe your issue is the same as the one I addressed in 2019, that you want to serialize a model relation as if it were an attribute. That being the case, the resolution is the same. In addition, if 0.8 is working for you you really should not try to update to 0.10. There's no benefit. I know you'd think there would be, but there isn't. |
I know it is the same issue and I read the whole thing. I dont see any
resolution just telling the OP how to “think” of the issue (model-relation
vs resource-attribute). That’s not the same as what I and OP are asking
for.
My issue is why doesn't “has_one” or the others use a serializer? Why
shouldn't the developer expect this? It used to work that way in 0.8
apparently. What should the developer do if they want their associations to
use their serializers?
Why provide instructions and guides on upgrading if you don’t think people
should?
This is the only outstanding issue I am having since upgrading.
|
I'm sorry to have to say it directly but your responses in this and the closed thread aren't helpful, and in fact are a bit rude and dismissive. We want to know why the association methods don't use the serializers and how to make them do that. I asked if your first comment meant I am expected to do it the way I showed and you still won't answer me. And if that is the answer, then I'd like the association methods to be clarified because if they don't use serializers (even when passing the :serializer option) then they don't make sense to me. I'm more than happy to hear the explanation, and I'm sure I could be convinced to the reasoning if it was just clarified. |
Also FYI, you did understand the issue #2247 (comment) (your comment is absolutely correct here) |
Hi @joemsak I don't know why a I know you're putting in time and I appreciate it. Too many people don't do that, so I want to let you know I really appreciate your engagement. I'm sorry that I'm more limited right now and not meeting your needs. |
@bf4 Thank you for your answer. Now it makes more sense to me. I get where you're coming from. We would love to migrate to a modern gem of course but the migration on a large legacy project will probably be hell. |
Issue #2247 was closed, but I'm having trouble figuring out what the resolution was.
The text was updated successfully, but these errors were encountered: