After switching to ActiveModel serializers (http://github.com/rails/ rails/commit/7cd1d37a51f5f53f8fc1360f886d26cabf12d969), ARes no longer uses the format's encode, bypassing it in favor of ActiveModel serialization. I would like to shield myself from the particular JSON returned by the service I'm consuming, and was planning on packing attributes in a particular manner using another format. Should ARes stick to using ActiveModel serialization? If so, where is the best place to hook into ARes so that I can manipulate the JSON body before record creation, and after serialization? Perhaps ARes::Base#encode can see if the format responds_to encode before punting it down to ActiveModel.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
activeresource json broken? | 0 | 99 | October 25, 2007 | |
jsonapi format deserialize ??? | 0 | 170 | August 6, 2015 | |
Out of date documentation? | 3 | 117 | February 13, 2009 | |
ActiveModel Serialization API: design and documentation | 4 | 188 | March 29, 2011 | |
Possible bug? ActiveResource in JSON format fails out of the box. | 0 | 131 | February 24, 2011 |