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.

To_json(:to_json => false) doesn't serialize complex types #14

@solnic

Description

@solnic

When calling to_json(:to_json=>false), I was expecting a hash with primitive types. However, properties and methods are pushed into the hash as is, w/o to_json serialization. To get the true json hash, I'd have to serialize to json and deserialize the data back:

reloaded_json = JSON.load(JSON.dump( json_representation ))

Here's a spec that captures this behavior: https://gist.github.com/777189 .


Created by Alexander Sorokin - 2011-01-13 00:52:08 UTC

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions