mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 06:04:08 -08:00
Fix for anomolies where asigned_type is not null but asigned_to is
This commit is contained in:
parent
37868cd70e
commit
e56f1ee6fd
|
@ -28,7 +28,7 @@ class MigrateDenormedAssetLocations extends Migration
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assigned to users - ::with('assignedTo') //can't eager-load polymorphic relations?
|
// Assigned to users - ::with('assignedTo') //can't eager-load polymorphic relations?
|
||||||
$assigned_user_assets = Asset::where('assigned_type',User::class)->get();
|
$assigned_user_assets = Asset::where('assigned_type',User::class)->whereNotNull('assigned_to')->get();
|
||||||
\Log::debug('User-assigned assets:');
|
\Log::debug('User-assigned assets:');
|
||||||
foreach ($assigned_user_assets as $assigned_user_asset) {
|
foreach ($assigned_user_assets as $assigned_user_asset) {
|
||||||
if ($assigned_user_asset->assignedTo->userLoc) {
|
if ($assigned_user_asset->assignedTo->userLoc) {
|
||||||
|
|
Loading…
Reference in a new issue