-
Hi, I've seen the guide and I'm trying to follow it but there are some points that I didn't find. The are some things that I'm not sure how to change that are blocking me at the moment. One is that I thought that I could keep associations using AMS, but it seems that doesn't work: class MySerializer < Oj::Serializer
belongs_to :user, serializer: MyAMSUserSerializer
end This throws:
I have The other is that Some other points that I noticed that I had to change, that I think at some point I can manage to fix:
Don't take me wrong, the library looks pretty promising and I understand replicating the whole AMS API isn't the goal, but I'm trying to figure out how to make the change! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi David!
Thanks for reporting, this is a bug in the latest versions, have a fix here:
These were low-hanging fruit, implemented in:
Usually, the best approach is to pass any additional information the serializer needs as options. As a temporary measure during migration, you could also use something like
This library targets |
Beta Was this translation helpful? Give feedback.
Hi David!
Thanks for reporting, this is a bug in the latest versions, have a fix here:
These were low-hanging fruit, implemented in:
scope
is not implemented in compat-mode because it makes serializers context-dependent, and is too implicit, making it more difficult to understand and unit test them.Usually, the best approach is to pass any additional information the serializer needs as options. As a temporary measure during migration, you could also use something like
RequestLocals
to share the current controller (or curre…