Skip to content

Error when use embeds_one relation #135

Open
@rjurado01

Description

@rjurado01

When you create a object with embeds_one relation object keywords are not saved.

I have write a test with the error: rjurado01@b81db46

The problem is that when you uses this syntax parent['child.property'] before it is persisted, mongoid doesn't return anything:

parent = Parent.new(child: Child.new(name: 'name'))
parent['child.new'] # this returns nil
parent.save
parent['child.new'] # this returns 'name'

And this gem uses this syntax in this line: https://github.com/mongoid/mongoid_search/blob/master/lib/mongoid_search/util.rb#L25

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