aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/serializers/xml_serializer.rb
Commit message (Collapse)AuthorAgeFilesLines
* Remove XML Serialization from core.Zachary Scott2015-08-071-193/+0
| | | | | | | This includes the following classes: - ActiveModel::Serializers::Xml - ActiveRecord::Serialization::XmlSerializer
* Remove most type related predicates from `Column`Sean Griffin2015-01-301-2/+2
| | | | | | Remaining are `limit`, `precision`, `scale`, and `type` (the symbol version). These will remain on the column, since they mirror the options to the `column` method in the schema definition DSL
* Remove `serialized?` from the type interfaceSean Griffin2014-06-131-5/+1
|
* Refactor XML serializer to not depend on `serialized_attributes`Geoff Petrie & Sean Griffin2014-06-011-3/+5
|
* Test the serialized types of virtual columns in XMLGeoff Petrie & Sean Griffin2014-06-011-2/+0
| | | | | | | The previous tests were passing, because nothing ever looked at the generated XML. What was previously being generated was `<firstname type="NilClass">...`, which is not consistent with all other cases where there is not a known type.
* 1.9 Syntax related changesAvnerCohen2012-11-101-7/+7
|
* Fix serializable_hash with xml generation and default :except optionCarlos Antonio da Silva2012-06-221-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | When generating xml with a custom implementation of serializable_hash, if using the :except option, it was being overriden by the default AR implementation that attempts to ignore the inheritance column from STI automatically. So, if you have an implementation like this: def serializable_hash(options={}) super({ except: %w(some_attr) }.merge!(options)) end The :except option was correctly being used for :json generation, but not for :xml, because the options hash already contained the :except key with the inheritance column, thus overriding the customization. This commit fixes this problem by removing the :except logic from the xml serializer, that happened before calling serializable_hash. Since serializable_hash also does the same check for inheritance column, this logic was duplicated in both places, thus it's safe to remove it from xml serializer (see ActiveRecord::Serialization#serializable_hash). This is an attempt to solve issue #2498, that claims for a "Single transformation API for both xml and json representations".
* changed xml type datetime to dateTime, fixes #6328Angelo capilleri2012-05-231-2/+2
| | | | | | | | | XmlMini define the xml 'datatime', but according to http://www.w3.org/TR/xmlschema-2/#dateTime could be better change this to 'dateTime' with upper case letter 'T. So 'DateTime' and 'Time' are redefined from 'datetime' to 'dateTime' add the changing to the changelog
* no need to check for this constantXavier Noria2012-02-071-1/+1
|
* Fixed the documenation for 'to_xml'Markus Fenske2012-02-071-1/+2
|
* Remove Array.wrap calls in ActiveRecordRafael Mendonça França2012-01-061-2/+1
|
* Revert "Implement ArraySerializer and move old serialization API to a new ↵José Valim2011-11-301-3/+3
| | | | | | | | | | | | | 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-3/+3
| | | | | | | | | | | | | 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.
* to_xml should also rely on serializable hash.José Valim2011-09-181-1/+1
|
* ActiveModel support for the :include serialization optionJohn Firebaugh2011-07-171-42/+0
| | | | | | | | | | | | | | | | | | | | 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.
* We already have the record; no need to retrieve it againJohn Firebaugh2011-07-171-2/+2
|
* Remove extra white spaces on ActiveRecord docs.Sebastian Martinez2011-05-231-1/+1
|
* dry up compute type in attributeAaron Patterson2010-12-151-16/+10
|
* to_xml doesn't work in such case: Event.select('title as t').to_xml [#4840 ↵Víctor Martínez2010-12-151-2/+8
| | | | | | state:resolved] NilClass.type is no longer defined in Ruby 1.9 and causes ActiveRecord::Base.to_xml to fail with message: undefined method `type' for nil:NilClass
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-1/+1
| | | | 's/[ \t]*$//' -i {} \;)
* to_xml with :include should skip_instruct on the included records [#4506 ↵Lawrence Pit2010-04-301-1/+1
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Move several configuration values from Hash to ActiveSupport::XmlMini, which ↵José Valim2010-04-291-50/+35
| | | | | | both Hash and Array depends on. Also, refactored ActiveModel serializers to just use ActiveSupport::XmlMini.to_tag. As consequence, if a serialized attribute is an array or a hash, it's not encoded as yaml, but as a hash or array.
* Speed up xml serializer by computing values just once and remove unecessary ↵José Valim2010-04-221-11/+0
| | | | code duplication.
* Avoid deprecated String#to_a by using Array.wrap(...) instead of Array(...)Jeremy Kemper2010-04-101-1/+2
|
* Break up concerns for choosing what attributes should be serialized and the ↵Joshua Peek2009-08-131-9/+10
| | | | actual serializer
* Patch to ActiveModel's (and ActiveRecord, by association) XML serialization: ↵John Maxwell2009-07-221-0/+15
| | | | | | If two parameters are present in Procs supplied to to_xml's :procs option, the model being serialized will be passed as the second argument [#2373 state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Integrate AMo XML serializer into ARJoshua Peek2009-07-111-109/+4
|
* Integrate AMo JSON serializer into ARJoshua Peek2009-07-031-5/+7
|
* Cherry-pick core extensionsJeremy Kemper2009-05-131-1/+4
|
* Ensure ActiveRecord#to_xml respects :skip_types for included associations ↵Bruce Krysiak2009-03-101-6/+12
| | | | | | [#1632 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Added a :camelize option to ActiveRecord and Hash to_xml serialization and ↵Bruce Krysiak2008-12-101-7/+16
| | | | | | from_xml deserialization Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Merge docrails.Pratik Naik2008-05-251-3/+3
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Improve documentation coverage and markupXavier Noria2008-05-021-15/+15
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Improve documentation.Pratik Naik2008-03-261-17/+40
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9093 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that to_xml should not automatically pass :procs to associations ↵David Heinemeier Hansson2007-12-031-8/+10
| | | | | | included with :include (closes #10162) [chuyeow] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8258 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Base#to_xml supports the nil="true" attribute like Hash#to_xml. Closes #8268.Jeremy Kemper2007-11-141-0/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8138 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Smattering of grammatical fixes to documentation. Closes #10083 [BobSilva]Marcel Molina2007-11-081-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8113 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add missing file for revision #8090Marcel Molina2007-11-061-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8092 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed spelling errors (closes #9706) [tarmo/rmm5t]David Heinemeier Hansson2007-09-281-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7666 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added :include option to to_json (closes #9677) [chuyeow]David Heinemeier Hansson2007-09-281-56/+38
| | | | 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/+327
: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