Nick Sutterer
Nick Sutterer
Try this: ```ruby property :created_at, exec_context: :decorator def created_at; super.to_s; end ```
@nlsrchtr Rendering or parsing?
I want to vomit! :nauseated_face: Can I see your representer class?
On a sidenote: You don't need `strong_parameters` with Roar/Representable, it filters automatically, the way it should be.
Hm, this is a `JSONAPI` issue and should be posted on https://github.com/trailblazer/roar-jsonapi - in pure Roar, my "trick" would be working™.
You can use the `::hash` property, please check the XML tests. I couldn't find it in the documentation myself, so might have missed to that. It works like ``` ruby...
I am pretty sure there's hash support out-of-the-box with Representable, my internet is terribly slow currently but I can try to find an example for you.
We left that out by intention! However, I agree with you that this might be handy. So you want the top representer to prepend that to the rendered XML doc?
Maybe we should have the following API? ``` ruby representer.to_xml(declaration: true) ``` That would go into `Representable::XML#to_xml`, @ShaneWilton!
Up to you, @ShaneWilton! I haven't used XML in ages and will probably never use it, again. I'm actually thinking of introducing `representable-xml` as a separate, community-managed gem.