Same thing here - I tried to reuse the Serialization API but found it way too complex and confusing, I think a rewrite would be best - still not sure why AM doesn't use ActiveSupport's serialization, though. That would make things much clearer.
Nick On 21 Mrz., 15:12, Evgeniy Dolzhenko <[email protected]> wrote: > > It doesn't make much sense to me how the Serialization API is designed > > and documented currently. Let me split both subjects. > > > ... > > Confirmed, had the same issues trying to use AM serialization on my > custom (non-AR) models. There is also another thing which I find confusing. > > ActiveModel::Serializers::JSON relies on serializable_hash method > provided by ActiveModel::Serialization. > > ActiveModel::Serializers::Xml for some reason doesn't use that instead > reimplementing serializable_hash from the scratch. > > In other words overriding serializable_hash would only affect JSON > serialization and not Xml one -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
