Unverified Commit 18c62a34 authored by rennokki's avatar rennokki Committed by GitHub

Merge pull request #1 from jenssegers/master

Pull from original repo
parents 0015e51b 3e5e9de2
......@@ -13,9 +13,10 @@ jobs:
matrix:
php: [7.1, 7.2, 7.3, 7.4]
os: ['ubuntu-latest']
mongodb: [3.6, 4.0, 4.2]
services:
mongo:
image: mongo
image: mongo:${{ matrix.mongodb }}
ports:
- 27017:27017
mysql:
......@@ -26,7 +27,7 @@ jobs:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: 'unittest'
MYSQL_ROOT_PASSWORD:
name: PHP ${{ matrix.php }} Test ${{ matrix.env }}
name: PHP ${{ matrix.php }} with mongo ${{ matrix.mongodb }}
steps:
- uses: actions/checkout@v1
......@@ -60,3 +61,4 @@ jobs:
run: vendor/bin/php-coveralls -v
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
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