Skip to content

Commit 33e4a8e

Browse files
committed
Remove and recategorize todos
1 parent 2479727 commit 33e4a8e

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/Bootstrappers/DatabaseTenancyBootstrapper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ public function bootstrap(Tenant $tenant): void
3232
throw new Exception('The template connection must NOT have URL defined. Specify the connection using individual parts instead of a database URL.');
3333
}
3434

35-
// Better debugging, but breaks cached lookup in prod
36-
if (app()->environment('local') || app()->environment('testing')) { // todo@docs mention this change in v4 upgrade guide https://github.com/archtechx/tenancy/pull/945#issuecomment-1268206149
35+
// Better debugging, but breaks cached lookup, so we disable this in prod
36+
if (app()->environment('local') || app()->environment('testing')) {
3737
$database = $tenant->database()->getName();
38-
if (! $tenant->database()->manager()->databaseExists($database)) { // todo@samuel does this call correctly use the host connection?
38+
if (! $tenant->database()->manager()->databaseExists($database)) { // todo@dbRefactor does this call correctly use the host connection?
3939
throw new TenantDatabaseDoesNotExistException($database);
4040
}
4141
}

src/Database/DatabaseConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public function manager(): Contracts\TenantDatabaseManager
222222
}
223223

224224
/**
225-
* todo@name come up with a better name
225+
* todo@dbRefactor come up with a better name
226226
* Get database manager class from the given connection config's driver.
227227
*
228228
* @throws DatabaseManagerNotRegisteredException

src/Database/TenantDatabaseManagers/PermissionControlledPostgreSQLSchemaManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function grantPermissions(DatabaseConfig $databaseConfig): bool
3030
$tables = $this->connection()->select("SELECT table_name FROM information_schema.tables WHERE table_schema = '{$schema}' AND table_type = 'BASE TABLE'");
3131

3232
// Grant permissions to any existing tables. This is used with RLS
33-
// todo@samuel refactor this along with the todo in TenantDatabaseManager
33+
// todo@dbRefactor refactor this along with the todo in TenantDatabaseManager
3434
// and move the grantPermissions() call inside the condition in `ManagesPostgresUsers::createUser()`
3535
// but maybe moving it inside $createUser is wrong because some central user may migrate new tables
3636
// while the RLS user should STILL get access to those tables

src/Middleware/PreventAccessFromUnwantedDomains.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,11 @@ protected function isCentralDomain(Request $request): bool
6666
return in_array($request->getHost(), config('tenancy.identification.central_domains'), true);
6767
}
6868

69-
// todo@samuel technically not an identification middleware but probably ok to keep this here
7069
public function requestHasTenant(Request $request): bool
7170
{
71+
// This middleware is special in that it's not an identification middleware
72+
// but still uses some logic from UsableWithEarlyIdentification, so we just
73+
// need to implement this method here. It doesn't matter what it returns.
7274
return false;
7375
}
7476
}

tests/Bootstrappers/FilesystemTenancyBootstrapperTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@
115115
test('storage_path helper does not change if suffix_storage_path is off', function() {
116116
$originalStoragePath = storage_path();
117117

118-
// todo@tests https://github.com/tenancy-for-laravel/v4/pull/44#issue-2228530362
119-
120118
config([
121119
'tenancy.bootstrappers' => [FilesystemTenancyBootstrapper::class],
122120
'tenancy.filesystem.suffix_storage_path' => false,

0 commit comments

Comments
 (0)