fixed issue with disk test, now with correct fix for redirection after creation

This commit is contained in:
Mark Gregory
2026-06-25 12:04:01 +01:00
parent 9564676ed3
commit 85e8d96655
7 changed files with 56 additions and 18 deletions
+15 -2
View File
@@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Support\Facades\Schema;
final class Comment extends Model
{
@@ -88,11 +89,23 @@ final class Comment extends Model
return $this->hasMany(Attachment::class, 'comment_id');
}
/** @param Builder<Comment> $query */
/**
* Scope the query to non-tombstoned comments when the legacy column exists.
*
* Some older Dusk databases can exist before the Lotus replication migration
* added tombstoned_at. In that state every row is active, so avoid issuing an
* invalid column query.
*
* @param Builder<Comment> $query
*
* @return Builder<Comment>
*/
public function scopeActive(Builder $query): Builder
{
if (! Schema::hasColumn($this->getTable(), 'tombstoned_at')) {
return $query;
}
return $query->whereNull('tombstoned_at');
}
}