aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/serializers/xml.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use #model_name on instances instead of classesAmiel Martin2014-06-241-1/+1
| | | | | | This allows rails code to be more confdent when asking for a model name, instead of having to ask for the class. Rails core discussion here: https://groups.google.com/forum/#!topic/rubyonrails-core/ThSaXw9y1F8
* Remove deprecated cattr_* requiresGenadi Samokovarov2013-12-031-1/+1
|
* it's xml, not jsonJohn Gesimondo2013-07-131-1/+1
| | | change docs for xml serializer to talk about xml
* Convert ActiveModel to 1.9 hash syntax.Patrick Robertson2013-05-011-5/+5
| | | | | I also attempted to fix other styleguide violations such as { a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ).
* chmod -x from non-script filesAkira Matsuda2012-12-241-0/+0
|
* Only call `in_time_zone` on Time or DateTime instancesAndrew White2012-12-111-1/+6
| | | | | Both String and Date now respond to in_time_zone so we need to check if the value is a Time or a DateTime.
* Specify type of singular association during serializationSteve Klabnik2012-11-281-1/+6
| | | | | | | | | | | | When serialising a class, specify the type of any singular associations, if necessary. Rails already correctly specifies the :type of any enumerable association (e.g. a has_many association), but made no attempt to do so for non-enumerables (e.g. a has_one association). We must specify the :type of any STI association. A has_one association to a class which uses single-table inheritance is an example of this type of association. Fixes #7471
* fix AM::Serializers titles [ci skip]Francesco Rodriguez2012-10-261-1/+1
|
* AM::Serializers::Xml depends on AM::NamingFrancesco Rodriguez2012-10-261-0/+4
|
* Following the false issue reporting I did here : ↵Anthony2012-08-131-0/+4
| | | | | | | | | | | https://github.com/rails/rails/issues/6958 - Enable propagation of :skip_types, :dasherize and :camelize on included models by default - Adding the option to override this propagation on a per-include basis (:include => { :model => { :dasherize => false } } - Enough tests to prove it works - Updated activemodel CHANGELOG.md Squashed my commits
* copy edits [ci skip]Vijay Dev2012-08-041-1/+1
|
* Fix ActiveModel::Serializers::Xml#to_xml referenceRobert Pankowecki2012-08-021-1/+1
| | | | Link to ActiveRecord::Serialization#to_xml for more details
* update ActiveModel::Serializers documentation [ci skip]Francesco Rodriguez2012-07-301-6/+30
|
* changed xml type datetime to dateTime, fixes #6328Angelo capilleri2012-05-231-1/+1
| | | | | | | | | 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
* Use respond_to?(:to_ary) rather than is_a?(Enumerable) to detect ↵Jon Leighton2012-05-111-1/+3
| | | | collection-thing.
* Remove Array.wrap call in ActiveModelRafael Mendonça França2012-01-061-3/+2
|
* Revert "Implement ArraySerializer and move old serialization API to a new ↵José Valim2011-11-301-5/+186
| | | | | | | | | | | | | 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-186/+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.
* to_xml should also rely on serializable hash.José Valim2011-09-181-31/+15
|
* ActiveModel support for the :include serialization optionJohn Firebaugh2011-07-171-0/+40
| | | | | | | | | | | | | | | | | | | | 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.
* use clearer variable name in examplesVijay Dev2011-06-041-2/+2
|
* Remove extra white spaces on ActiveModel docs.Sebastian Martinez2011-05-231-2/+2
|
* Attributes with :string type should not be given the type passed in model ↵Jim Herzberg2011-05-181-1/+1
| | | | serialization options. Closes #1058
* Methods that return nil should not be considered YAMLJoshua Wehner2011-05-101-0/+1
|
* copy-edits 34316d8Xavier Noria2011-02-211-7/+5
|
* Docs: Update to_xml documentation to match as_json docuemntationNicholas Rowe2011-02-201-0/+25
|
* Take into account current time zone when serializing datetime values [#6096 ↵Mike Dvorkin2010-12-091-0/+1
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Perf: refactor methods using inject when not need in activemodel.Emilio Tagua2010-09-221-4/+3
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* ActiveModel#to_xml fix (renamed parameter).Andreas Garnæs2010-09-021-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-1/+1
| | | | 's/[ \t]*$//' -i {} \;)
* Added headings to serializers.Rizwan Reza2010-06-141-0/+3
|
* Make ActiveResource serialize XML correctly when element_name is set.Santiago Pastorino2010-05-121-1/+1
| | | | | | [#4529] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Move several configuration values from Hash to ActiveSupport::XmlMini, which ↵José Valim2010-04-291-111/+51
| | | | | | 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-18/+17
| | | | code duplication.
* Use Array.wrap uniformlyJeremy Kemper2010-03-271-1/+2
|
* Adding documentation for ActiveModel::SerializationMikel Lindsaar2010-01-171-2/+2
|
* Break up concerns for choosing what attributes should be serialized and the ↵Joshua Peek2009-08-131-24/+52
| | | | actual serializer
* Dasherize XML root by default to avoid invalid tags ↵Joshua Peek2009-07-221-1/+1
| | | | "<admin/posts>...</admin/posts>" [#2875 state:resolved]
* Patch to ActiveModel's (and ActiveRecord, by association) XML serialization: ↵John Maxwell2009-07-221-1/+5
| | | | | | 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>
* Kill AMo ivar attributes helperJoshua Peek2009-07-201-1/+0
|
* Integrate AMo XML serializer into ARJoshua Peek2009-07-111-22/+27
|
* Initial extraction of AMo xml serializerJoshua Peek2009-07-031-0/+168