noosfero | Add active_model_serializers gem for organized serialization (#669)

Bráulio Bhavamitra gitlab at gitlab.com
Mon Sep 21 12:53:55 BRT 2015


New comment for Merge Request 669

https://gitlab.com/noosfero/noosfero/merge_requests/669#note_2164000


Bráulio Bhavamitra

doing it on the models with `as_json` can really bloat them. also, it cannot easily afford multiple serialization forms. please read:
https://robots.thoughtbot.com/better-serialization-less-as-json
http://eewang.github.io/blog/2013/07/23/using-activemodel-serializers-to-build-great-json-interfaces/
http://railscasts.com/episodes/409-active-model-serializers

another benefit is to encapsulate logic into classes called serializers.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150921/4582b23b/attachment.html>


More information about the Noosfero-dev mailing list