aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/serialization.rb
Commit message (Collapse)AuthorAgeFilesLines
* Implement ArraySerializer and move old serialization API to a new namespace.José Valim2011-11-231-1/+1
| | | | | | | | | | | | | 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.
* ActiveModel support for the :include serialization optionJohn Firebaugh2011-07-171-39/+1
| | | | | | | | | | | | | | | | | | | | 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.
* Don't merge base opts into includes when serializing ARsJohn Mileham2011-05-261-6/+2
| | | | | | Conflicts: activerecord/lib/active_record/serialization.rb
* Syntax cleanup: for in => eachGuillermo Iguaran2011-05-191-1/+1
|
* Merge branch 'master' of git://github.com/lifo/docrailsXavier Noria2010-10-061-1/+1
|\
| * Fix serialization :include option nameEvgeniy Dolzhenko2010-10-011-1/+1
| |
* | double negative is not goodNeeraj Singh2010-09-301-1/+1
|/
* fixed some issues with JSON encodingJakub Suder2010-09-071-1/+1
| | | | | | | | | | | - 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>
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-1/+1
| | | | 's/[ \t]*$//' -i {} \;)
* Adds title and proper formatting to docs.Rizwan Reza2010-06-161-0/+2
|
* Break up concerns for choosing what attributes should be serialized and the ↵Joshua Peek2009-08-131-41/+39
| | | | actual serializer
* Integrate AMo JSON serializer into ARJoshua Peek2009-07-031-55/+13
|
* Fix AR json encodingJeremy Kemper2009-06-081-2/+3
|
* Cherry-pick core extensionsJeremy Kemper2009-05-131-8/+9
|
* Use Array.wrapJeremy Kemper2009-04-261-4/+4
|
* require json lib when serialization is loadedJoshua Peek2008-11-241-0/+2
|
* Autoload ActiveRecord filesJoshua Peek2008-11-241-1/+1
|
* Improve documentation coverage and markupXavier Noria2008-05-021-5/+5
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Added :include option to to_json (closes #9677) [chuyeow]David Heinemeier Hansson2007-09-281-6/+45
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7663 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added ActiveRecord::Base#to_json/from_json (currently does not support ↵David Heinemeier Hansson2007-09-201-0/+59
:include like to_xml) [DHH]. Added ActiveRecord::Base#from_xml [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7519 5ecf4fe2-1ee6-0310-87b1-e25e094e27de