Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when use embeds_one relation #135

Open
rjurado01 opened this issue Nov 14, 2018 · 0 comments
Open

Error when use embeds_one relation #135

rjurado01 opened this issue Nov 14, 2018 · 0 comments

Comments

@rjurado01
Copy link
Contributor

rjurado01 commented Nov 14, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant