mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 05:24:03 +00:00
Fix #998, properly replace ALL tenant_id literals
This commit is contained in:
parent
8a00a105d0
commit
2a39b0526a
11 changed files with 35 additions and 22 deletions
|
|
@ -14,6 +14,7 @@ use Stancl\Tenancy\Database\TenantCollection;
|
|||
use Stancl\Tenancy\Events\SyncedResourceChangedInForeignDatabase;
|
||||
use Stancl\Tenancy\Events\SyncedResourceSaved;
|
||||
use Stancl\Tenancy\Exceptions\ModelNotSyncMasterException;
|
||||
use Stancl\Tenancy\Tenancy;
|
||||
|
||||
// todo@v4 review all code related to resource syncing
|
||||
|
||||
|
|
@ -77,7 +78,7 @@ class UpdateSyncedResource extends QueueableListener
|
|||
/** @var Tenant */
|
||||
$tenant = $event->tenant;
|
||||
|
||||
return ((string) $model->pivot->tenant_id) === ((string) $tenant->getTenantKey());
|
||||
return ((string) $model->pivot->getAttribute(Tenancy::tenantKeyColumn())) === ((string) $tenant->getTenantKey());
|
||||
};
|
||||
|
||||
$mappingExists = $centralModel->tenants->contains($currentTenantMapping);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue