session-ios/SessionUtilitiesKit/Database/Utilities/PersistableRecord+Utilities.swift
Morgan Pretty 32304ae5dd Cleared out some of the legacy serialisation logic, further UI binding
Refactored the SignalApp class to Swift
Fixed a horizontal alignment issue in the ConversationTitleView
Fixed an issue where expiration timer update messages weren't migrated or rendering correctly
Fixed an issue where expiring messages weren't migrated correctly
Fixed an issue where closed groups which had been left were causing migration failures (due to data incorrectly being assumed to be required)
Shifted the Legacy Attachment types into the 'SMKLegacy' namespace
Moved all of the NSCoding logic for the TSMessage
2022-05-03 17:14:56 +10:00

17 lines
429 B
Swift

// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
import Foundation
import GRDB
public extension Array where Element: PersistableRecord {
@discardableResult func deleteAll(_ db: Database) throws -> Bool {
return try self.reduce(true) { prev, next in
try (prev && next.delete(db))
}
}
func saveAll(_ db: Database) throws {
try forEach { try $0.save(db) }
}
}