fix(file-storage): double save on compose volumes

This commit is contained in:
Andras Bacsai
2025-03-28 22:10:33 +01:00
parent 0bb47dfa56
commit c2941abe57
2 changed files with 49 additions and 39 deletions

View File

@@ -176,4 +176,19 @@ class LocalFileVolume extends BaseModel
return instant_remote_process($commands, $server);
}
// Accessor for convenient access
protected function plainMountPath(): Attribute
{
return Attribute::make(
get: fn () => $this->mount_path,
set: fn ($value) => $this->mount_path = $value
);
}
// Scope for searching
public function scopeWherePlainMountPath($query, $path)
{
return $query->get()->where('plain_mount_path', $path);
}
}