You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a AR model that has a db column called state, and I want to transform it before serializing the data. That method that transforms data lives on the AR model
When delegating the method to the AR object + aliasing it, panko is not working the way I would expect. it's returning the actual persisted database value for object#state
I see what you say and totally agree, this happens because aliases works on attributes and not on methods.
Since serializer is not strict to specific model (as of today), I can't know if "friendly_state" is a method on a model and then alias to it's method.
Making serializers strongly typed, is something I want to achieve in the future but not now.
I'll try to think about an options how to solve this without complicating the library.
If you want to submit PR and need help with it, I'll be gladly guide you (you can join the Slack group)
I have a AR model that has a db column called state, and I want to transform it before serializing the data. That method that transforms data lives on the AR model
When delegating the method to the AR object + aliasing it, panko is not working the way I would expect. it's returning the actual persisted database value for object#state
I can accomplish what I want by doing but I think it would be a better approach to be able to rely on aliases + method delegation
The text was updated successfully, but these errors were encountered: