Skip to content

Issues with DelegateClass. #919

@tomasmiguez

Description

@tomasmiguez

We started using DelegateClass on our codebase recently, and are experiencing some compatibility issues with Oj.
The main problem has already been reported here #477, but the proposed solution does not work for our use case.
We currently use this options on the dump method calls

      options = {
        create_additions: false,
        mode: :compat,
        time_format: :xmlschema,
        second_precision: 0,
        use_to_hash: true
      }

but if we change it to compat, we have 2 problems:

  • time_format is not valid for that mode, so we can't keep this change transparent.
  • Decimal numbers are getting serialized as strings. We thought this might be fixed by setting compat_bigdecimal to false or true, but that did not work either.

How can we get delegate objects to serialize only the underlying object? And not the attributes of the delegate that are anecdotic?

For aditional context, Sequel uses Delegate classes in their implementation and this is causing our problems here: jeremyevans/sequel#2153

Thanks in advance,
Tomas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions