aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/serialization_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* No such class since 8d2866bb80fbe81acb04f5b0c44f152f571fb29fAkira Matsuda2019-08-021-1/+1
|
* Merge pull request #28270 from mmangino/dont_ignore_seralization_optionsRyuta Kamizono2018-02-271-0/+7
|\ | | | | | | Don't accidentally lose includes in serialization
| * Fix styleMike Mangino2017-03-031-1/+1
| |
| * Don't accidentally lose includes in serializationMike Mangino2017-03-031-3/+9
| |
* | Use frozen string literal in activemodel/Kir Shatrov2017-07-161-0/+2
| |
* | Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | | | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* | Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|/
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-32/+32
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-34/+34
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies new string literal convention in activemodel/testXavier Noria2016-08-061-18/+18
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* ensure `method_missing` called for non-existing methods passed toJay Elaraj2015-04-281-9/+16
| | | | `ActiveModel::Serialization#serializable_hash`
* Convert ActiveModel to 1.9 hash syntax.Patrick Robertson2013-05-011-17/+17
| | | | | I also attempted to fix other styleguide violations such as { a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ).
* Use respond_to?(:to_ary) rather than is_a?(Enumerable) to detect ↵Jon Leighton2012-05-111-0/+18
| | | | collection-thing.
* Make sure serializable hash with :include always returns string keysCarlos Antonio da Silva2012-03-091-13/+13
|
* Make sure serializable hash with :methods option returns always string keysCarlos Antonio da Silva2012-02-131-3/+3
|
* Cleanup extra spacesCarlos Antonio da Silva2012-02-131-45/+44
|
* Revert "Implement ArraySerializer and move old serialization API to a new ↵José Valim2011-11-301-0/+151
| | | | | | | | | | | | | 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-151/+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.
* Fixed serialization issues with multiple includes with optionszhengjia2011-10-111-0/+8
|
* Provide read_attribute_for_serialization as the API to serialize attributes.José Valim2011-09-301-3/+3
|
* Make serializable_hash take attr values directly from attributes hash.Jon Leighton2011-09-261-0/+9
| | | | | | | | | | | | Previously, it would use send() to get the attribute. In Active Resource, this would rely on hitting method missing. If a method with the same name was defined further up the ancestor chain, that method would wrongly be called. This change fixes test_to_xml_with_private_method_name_as_attribute in activeresource/test/cases/base_test.rb, which was broken after 51bef9d8fb0b4da7a104425ab8545e9331387743, because that change made to_xml use serializable_hash.
* added more tests for only-include and except-include options in serializationAnand2011-08-231-1/+14
|
* 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>