Skip to content

associate() not working on embedsOne #215

@mikebronner

Description

@mikebronner

When trying the following:

$user->address()->associate($address);

I get the following error:

BadMethodCallException
Call to undefined method Jenssegers\Mongodb\Query\Builder::associate()

I use associate to add sub-documents to a model without having to make a database call using save(). After everything is associated to the main model, I then call save() on that.

This works for other relationships, could this be added to work with embedsOne?

Thanks! :)

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