File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Sources/Alchemy/Filesystem Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import Papyrus
3
3
import NIOCore
4
4
5
5
// File
6
- public struct File : Codable , ResponseConvertible {
6
+ public struct File : Codable , ResponseConvertible , ModelProperty {
7
7
public enum Source {
8
8
// The file is stored in a `Filesystem` with the given path.
9
9
case filesystem( Filesystem ? = nil , path: String )
@@ -88,12 +88,12 @@ public struct File: Codable, ResponseConvertible {
88
88
89
89
// MARK: ModelProperty
90
90
91
- init ( key: String , on row: SQLRowReader ) throws {
91
+ public init ( key: String , on row: SQLRowReader ) throws {
92
92
let name = try row. require ( key) . string ( )
93
93
self . init ( name: name, source: . filesystem( Storage, path: name) )
94
94
}
95
95
96
- func store( key: String , on row: inout SQLRowWriter ) throws {
96
+ public func store( key: String , on row: inout SQLRowWriter ) throws {
97
97
guard case . filesystem( _, let path) = source else {
98
98
throw RuneError ( " currently, only files saved in a `Filesystem` can be stored on a `Model` " )
99
99
}
You can’t perform that action at this time.
0 commit comments