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.

Allow properties to be converted back to their underlying field names #19

@d11wtq

Description

@d11wtq

I'm working on the dm-rest-adapter code, which uses dm-serializer. Currently that code does not correctly honour :field options on properties, since it just calls #to_xml on the resource, so I'll have to post-process the result.

Perhaps a :raw => true option, or some such would be useful?

@user.to_json
# =>
{
  "id" : 42,
  "full_name" : "Testy McTesty"
  "date_of_birth" : "1980-10-01"
}

@user.to_json(:raw => true)
# =>
{
  "user_id" : 42,
  "fullname" : "Testy McTesty",
  "dob" : "1980-10-01"
}

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