aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/serialization.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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