It doesn't make much sense to me how the Serialization API is designed and documented currently. Let me split both subjects.

Design

Why does the API require an 'attributes' method if the module only uses its keys? I guess attributes should either return an array of the keys to be serialized or be renamed to something like 'attribute_keys'. Another option would be ActiveModel::Serialization to maintain the attributes hash up-to-date as well as using the initial values of the hash.

It seems the API is designed this way so that it fits the ActiveRecord API. But for this to make sense as an independent module, it should implement more from ActiveRecord like maintaining the attributes hash up-to-date.

Documentation

What is the reason for 'to_json' not appearing in generated documentation? I mean, "to_json" is documented in the "as_json" method but the last one returns a hash while the former returns a string.


Thanks in advance,

Rodrigo.

--
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.

Reply via email to