Skip to content

Suggestions on formatting JSON serialization? #86

@chrismanderson

Description

@chrismanderson

Hello! Experimenting with the gem with a basic rails api - any suggestions on a good entry point/mechanism for customizing the JSON output of a ActiveRecord attribute storing a Tod::TimeOfDay? I'd like to show the outpost as a '11:00:00' for example rather than the components.

I'm just using a simple as_json for my models. There's lots of ways of doing this of course, adding a method that does the string formatting, using ActiveModelSerializers and overriding the attribute getter, but I'd like to find a higher-level way of customizing the output, if possible. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions