mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Merge branch 'develop' of github.com:snipe/snipe-it into develop
This commit is contained in:
commit
a305b1ea2d
|
@ -59,7 +59,18 @@ class Location extends SnipeModel
|
|||
|
||||
public function locationAssets()
|
||||
{
|
||||
return $this->hasMany('\App\Models\Asset', 'rtd_location_id')->orHas('assignedAssets');
|
||||
/* This used to have an ...->orHas() clause that referred to
|
||||
assignedAssets, and that was probably incorrect, as well as
|
||||
definitely was setting fire to the query-planner. So don't do that.
|
||||
|
||||
It is arguable that we should have a '...->whereNull('assigned_to')
|
||||
bit in there, but that isn't always correct either (in the case
|
||||
where a user has no location, for example).
|
||||
|
||||
In all likelyhood, we need to denorm an "effective_location" column
|
||||
into Assets to make this slightly less miserable.
|
||||
*/
|
||||
return $this->hasMany('\App\Models\Asset', 'rtd_location_id');
|
||||
}
|
||||
|
||||
public function parent()
|
||||
|
|
Loading…
Reference in a new issue