aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/serializers/xml_serialization_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Implement ArraySerializer and move old serialization API to a new ↵José Valim2011-11-301-0/+208
| | | | | | | | | | | | | namespace." This reverts commit 8896b4fdc8a543157cdf4dfc378607ebf6c10ab0. Conflicts: activemodel/lib/active_model.rb activemodel/lib/active_model/serializable.rb activemodel/lib/active_model/serializer.rb activemodel/test/cases/serializer_test.rb
* Implement ArraySerializer and move old serialization API to a new namespace.José Valim2011-11-231-206/+0
| | | | | | | | | | | | | The following constants were renamed: ActiveModel::Serialization => ActiveModel::Serializable ActiveModel::Serializers::JSON => ActiveModel::Serializable::JSON ActiveModel::Serializers::Xml => ActiveModel::Serializable::XML The main motivation for such a change is that `ActiveModel::Serializers::JSON` was not actually a serializer, but a module that when included allows the target to be serializable to JSON. With such changes, we were able to clean up the namespace to add true serializers as the ArraySerializer.
* to_xml should also rely on serializable hash.José Valim2011-09-181-0/+17
|
* ActiveModel support for the :include serialization optionJohn Firebaugh2011-07-171-2/+50
| | | | | | | | | | | | | | | | | | | | This commit moves support for the :include serialization option for serializing associated objects out of ActiveRecord in into ActiveModel. The following methods support the :include option: * serializable_hash * to_json * to_xml Instances must respond to methods named by the values of the :includes array (or keys of the :includes hash). If an association method returns an object that is_a?(Enumerable) (which AR has_many associations do), it is assumed to be a collection association, and its elements must respond to :serializable_hash. Otherwise it must respond to :serializable_hash itself. While here, fix #858, XmlSerializer should not singularize already singular association names.
* Attributes with :string type should not be given the type passed in model ↵Jim Herzberg2011-05-181-1/+7
| | | | serialization options. Closes #1058
* Methods that return nil should not be considered YAMLJoshua Wehner2011-05-101-0/+4
|
* Rename test directory to match code directoryJohn Firebaugh2011-04-061-0/+131
Hopefully "serializeration" is not an in joke that I missed.