How to include methods in the JSON representation of a model
Here’s a short blog post about using active_model_serializers
, so you can all get rid of your as_json, to_json and serializable_hash monkey patches:
https://christoph.luppri.ch/articles/2016/09/22/how-to-include-methods-in-the-json-representation-of-a-model/
Post a comment