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
The objects gets serialized, but not its class definition with includes the extended methods.
A solution is to roll out a presenter that looks like this:
moduleGrapemoduleRoarmoduleRepresenterdefself.included(base)base.extend(ClassMethods)endmoduleClassMethodsdefrepresent(object,options={})object.extendselfobject.as_json(options)# usually cannot be `to_json` because Grape formatter would re-encode thisendendendendend
Maybe this should just be a class called Grape::Roar::Representer::JSON?
The text was updated successfully, but these errors were encountered:
If you put
present instance, with: Presenter
inside a cache block, it cannot be serialized. That is because its implementation looks like this:The objects gets serialized, but not its class definition with includes the extended methods.
A solution is to roll out a presenter that looks like this:
Maybe this should just be a class called
Grape::Roar::Representer::JSON
?The text was updated successfully, but these errors were encountered: