aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/serialization_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* ActiveModel support for the :include serialization optionJohn Firebaugh2011-07-171-6/+67
| | | | | | | | | | | | | | | | | | | | 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.
* Add a testJohn Firebaugh2011-07-171-0/+5
|
* serializable_hash(:only => [], :methods => [:foo]) should workJohn Firebaugh2011-07-171-0/+10
|
* adding new test for ActiveModel::SerializationNeeraj Singh2010-08-311-0/+45
Signed-off-by: José Valim <jose.valim@gmail.com>