Skip to content

Commit bf594ae

Browse files
Conform File to ModelProperty
1 parent f2599c8 commit bf594ae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/Alchemy/Filesystem/File.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Papyrus
33
import NIOCore
44

55
// File
6-
public struct File: Codable, ResponseConvertible {
6+
public struct File: Codable, ResponseConvertible, ModelProperty {
77
public enum Source {
88
// The file is stored in a `Filesystem` with the given path.
99
case filesystem(Filesystem? = nil, path: String)
@@ -88,12 +88,12 @@ public struct File: Codable, ResponseConvertible {
8888

8989
// MARK: ModelProperty
9090

91-
init(key: String, on row: SQLRowReader) throws {
91+
public init(key: String, on row: SQLRowReader) throws {
9292
let name = try row.require(key).string()
9393
self.init(name: name, source: .filesystem(Storage, path: name))
9494
}
9595

96-
func store(key: String, on row: inout SQLRowWriter) throws {
96+
public func store(key: String, on row: inout SQLRowWriter) throws {
9797
guard case .filesystem(_, let path) = source else {
9898
throw RuneError("currently, only files saved in a `Filesystem` can be stored on a `Model`")
9999
}

0 commit comments

Comments
 (0)