aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/serializers
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Merge pull request #2378 from cesario/remove_warnings_activemodel"Jon Leighton2011-11-051-1/+0
| | | | | | | This reverts commit 6aaae3de277b572f37e09f16ae12737c3c87dfb7, reversing changes made to fdbc4e5f4e5746ebf558485348c841b33f038fda. Reason: build failure.
* Merge pull request #2378 from cesario/remove_warnings_activemodelVijay Dev2011-11-051-0/+1
|\ | | | | Remove warnings by calling remove_method
| * Remove warnings by calling remove_methodFranck Verrot2011-07-311-0/+1
| |
* | Fixing `as_json` method for ActiveRecord models.Nicolás Hock Isaza2011-09-291-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | When you've got an AR Model and you override the `as_json` method, you should be able to add default options to the renderer, like this: class User < ActiveRecord::Base def as_json(options = {}) super(options.merge(:except => [:password_digest])) end end This was not possible before this commit. See the added test case.
* | fixed a bug with the json serialization when the class setting is set to not ↵Matt Aimonetti2011-09-221-0/+10
| | | | | | | | include the root, but an instance is serialized with the root option passed as true
* | 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.
* Enable passing root: false to #to_jsonJoe Fiorini2011-07-011-1/+52
|
* 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-062-0/+279
Hopefully "serializeration" is not an in joke that I missed.