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
We started using Roar::Decorator's a while ago so I forget if this was an issue on modules too, but definitely the case on Decorator's.... I've been burned by this a few times now when I forget about it, it feels like a bug to me, but perhaps it's documented/known? Seems like it would be nice to use it when it's specified though.
Normally this would work fine without the getter option, but when the getter is present, it's response is not passed through the specified representer and instead has to_json called on it directly or something.
The text was updated successfully, but these errors were encountered:
We started using Roar::Decorator's a while ago so I forget if this was an issue on modules too, but definitely the case on Decorator's.... I've been burned by this a few times now when I forget about it, it feels like a bug to me, but perhaps it's documented/known? Seems like it would be nice to use it when it's specified though.
To provide an example:
class V3::AnswerRepresenter < Roar::Decorator
property :id
property :response, represent_with: V3::ResponseRepresenter, getter: ->(opts) { responses.first }, embedded: true
end
Normally this would work fine without the getter option, but when the getter is present, it's response is not passed through the specified representer and instead has to_json called on it directly or something.
The text was updated successfully, but these errors were encountered: