Skip to content

Don't set the field to have nested empty hashes unless explicitly told to do so. #3

@NullVoxPopuli

Description

@NullVoxPopuli

Desired behavior:

metadata = Metadata.new
metadata.data.should be_nil
metadata.data.nested_data.should be_nil
metadata.should == {}
metadata.data = {}
metadata.should == {data: {}}

Current Behavior:

metadata = Metadata.new
metadata.data == {}
metadata.data.nested_data == {}
metadata == {data: {nested_data: {}}

this is a problem if one of the nested keys we call is eventually supposed to be a non Hash

example:

metadata = Metadata.new
id = metadata.property.id
klass.find(id)

=> errors cause id is a hash, rather than an id or nil

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