Commit 692461e5 authored by Smolevich's avatar Smolevich

Merge branch 'master' of github.com:jenssegers/laravel-mongodb into add-matrix-mongodb

parents f3021c2b 69e4da5d
preset: laravel
......@@ -184,7 +184,7 @@ trait HybridRelations
// there are multiple types in the morph and we can't use single queries.
if (($class = $this->$type) === null) {
return new MorphTo(
$this->newQuery(), $this, $id, null, $type, $name
$this->newQuery(), $this, $id, $ownerKey, $type, $name
);
}
......@@ -195,8 +195,10 @@ trait HybridRelations
$instance = new $class;
$ownerKey = $ownerKey ?? $instance->getKeyName();
return new MorphTo(
$instance->newQuery(), $this, $id, $instance->getKeyName(), $type, $name
$instance->newQuery(), $this, $id, $ownerKey, $type, $name
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment