Skip to content
This repository was archived by the owner on Apr 17, 2018. It is now read-only.
This repository was archived by the owner on Apr 17, 2018. It is now read-only.

[dm-serializers] better support for deep object tree #17

@solnic

Description

@solnic

the to_xml can pass in two options :collection_element_name or :element_name whether it is a collection or a single resource. but with this it is very difficult to just change the "storage name". this gist illustrate it: http://gist.github.com/241055

so I think the better way to do define the element name would be using the storage name of resource. the default naming convention for table names are perfect XML element names !!

the patch also includes an issue when I have something like this:

class Child
include DataMapper::Resource

belongs_to :mother, :model => Child
belongs_to :father, :model => Child
end

then child.to_xml(:methods => [:mother, :father]) should produce following xml

currently I get

the last issue I came across was that a property value was frozen and that produces stacktrace in one of the xml serializiers.

so I just want to share my current fork od dm-serializer and if the patches are going to be included then I can add a few more specs for the changes.


Created by kristian - 2009-11-23 13:16:18 UTC

Original Lighthouse ticket: http://datamapper.lighthouseapp.com/projects/20609/tickets/1132

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions