ARes, Format, and Encoding

Micah Frost
Wed, 13 Oct 2010 20:22:45 -0000

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.

--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at