aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/serialization.rb
Commit message (Collapse)AuthorAgeFilesLines
* :scissors: and :nail_care: from d60c405 [ci skip]Zachary Scott2014-06-161-3/+3
|
* [ci skip] correct doc for serialization in accordance with API Doc GuideAditya Kapoor2014-06-161-11/+11
|
* Fix few typos and improve markup at some levelsRobin Dupret2013-12-241-1/+1
|
* Replace comments' non-breaking spaces with spacesclaudiob2012-12-041-1/+1
| | | | | | | | | | Sometimes, on Mac OS X, programmers accidentally press Option+Space rather than just Space and don’t see the difference. The problem is that Option+Space writes a non-breaking space (0XA0) rather than a normal space (0x20). This commit removes all the non-breaking spaces inadvertently introduced in the comments of the code.
* minor edits in AM documentation [ci skip]Francesco Rodriguez2012-10-211-1/+1
|
* update ActiveModel::Serialization documentation [ci skip]Francesco Rodriguez2012-07-061-14/+36
|
* Merge pull request #5678 from troyk/patch-1Carlos Antonio da Silva2012-05-191-1/+1
|\ | | | | Remove sort on attributes.keys
| * Remove sort on attributes.keysTroy Kruthoff2012-03-301-1/+1
| |
* | Missed colonAlexey Vakhov2012-05-141-1/+1
| |
* | Use respond_to?(:to_ary) rather than is_a?(Enumerable) to detect ↵Jon Leighton2012-05-111-2/+2
| | | | | | | | collection-thing.
* | Use <tt>Foo::Bar</tt> instead of +Foo::Bar+Mark Rushakof2012-04-271-1/+1
| | | | | | | | | | | | | | | | The latter doesn't render as code in HTML output. Regex used in Rubymine to locate the latter form: (\+)(:*\w+:(?::|\w)+)(\+)
* | Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-04-251-5/+11
|\ \
| * | fix code syntaxOscar Del Ben2012-04-251-2/+2
| | |
| * | Add include documentation to serializationOscar Del Ben2012-04-251-1/+6
| | |
| * | improve serialization docOscar Del Ben2012-04-251-4/+5
| |/
* / Minor refactor of serializable hashOscar Del Ben2012-04-251-2/+1
|/
* Rename variable to avoid using name "include"Carlos Antonio da Silva2012-03-091-8/+4
| | | | Better syntax highlight :)
* Remove Array#wrap usage in AMo serializationCarlos Antonio da Silva2012-03-091-2/+1
|
* Make sure serializable hash with :include always returns string keysCarlos Antonio da Silva2012-03-091-2/+1
|
* Merge pull request #5018 from hammerdr/issue-4659-docsAaron Patterson2012-02-131-4/+7
|\ | | | | Adding documentation to clarify usage of attributes hash.
| * Missed a code example. Fixing the docs to be consistant.Derek Hammer2012-02-121-1/+1
| |
| * Adding documentation to clarify usage of attributes hash.Derek Hammer2012-02-121-3/+6
| | | | | | | | | | | | Serialization uses only the attributes hash's keys and calls methods that are of the same name as the keys on the serialized object.
* | Make sure serializable hash with :methods option returns always string keysCarlos Antonio da Silva2012-02-131-1/+1
|/
* Remove Array.wrap call in ActiveModelRafael Mendonça França2012-01-061-3/+3
|
* Revert "Implement ArraySerializer and move old serialization API to a new ↵José Valim2011-11-301-5/+134
| | | | | | | | | | | | | 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-134/+5
| | | | | | | | | | | | | 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-1/+1
|
* Provide read_attribute_for_serialization as the API to serialize attributes.José Valim2011-09-301-2/+23
|
* Make serializable_hash take attr values directly from attributes hash.Jon Leighton2011-09-261-1/+3
| | | | | | | | | | | | 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 missing require array/wrap in serializationAnand2011-08-231-0/+2
|
* ActiveModel support for the :include serialization optionJohn Firebaugh2011-07-171-1/+32
| | | | | | | | | | | | | | | | | | | | 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.
* Replace map+compact with selectJohn Firebaugh2011-07-171-1/+1
|
* serializable_hash(:only => [], :methods => [:foo]) should workJohn Firebaugh2011-07-171-7/+4
|
* Remove extra white spaces on ActiveModel docs.Sebastian Martinez2011-05-231-1/+1
|
* Fixed broken, memoized attributes method exampleNathaniel Bibler2011-02-071-2/+2
| | | | | | [#6245 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* 'nil' => nilAkira Matsuda2010-12-171-2/+2
|
* Perf: refactor methods using inject when not need in activemodel.Emilio Tagua2010-09-221-9/+2
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* fixed some issues with JSON encodingJakub Suder2010-09-071-8/+10
| | | | | | | | | | | - as_json in ActiveModel should return a hash and handle :only/:except/:methods options - Array and Hash should call as_json on their elements - json methods should not modify options argument [#5374 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* to_json => as_jsonJames Miller2010-08-251-2/+2
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-22/+22
| | | | 's/[ \t]*$//' -i {} \;)
* adding documentation to ActiveSupport::Concern ht:strictly typed for an ↵Neeraj Singh2010-08-041-0/+2
| | | | | | awesome example some minor documentation changes
* Revised and added headings.Rizwan Reza2010-06-141-0/+2
|
* Full update on ActiveModel documentationMikel Lindsaar2010-02-011-0/+57
|
* Break up concerns for choosing what attributes should be serialized and the ↵Joshua Peek2009-08-131-0/+30
actual serializer