Skip to content

Commit

Permalink
Properly process frozen entities
Browse files Browse the repository at this point in the history
They just got skipped from the result set,
which is wrong.
  • Loading branch information
helje5 committed Oct 1, 2023
1 parent 16e4f99 commit 5575eba
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Sources/ManagedModels/SchemaGeneration/SchemaBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,17 @@ public final class SchemaBuilder {
entities: inout [ NSEntityDescription ])
{
// Note: This is called recursively
var allFrozen = false
var allFrozen = true

// Create the basic entity and property data
for modelType in modelTypes {
guard !isFrozen(modelType) else { continue }
if isFrozen(modelType) {
if let entity = lookupEntity(modelType) {
entities.append(entity)
continue
}
assertionFailure("Type frozen, but no entity found?")
}
allFrozen = false
if let newEntity = processModel(modelType) {
entities.append(newEntity)
Expand Down

0 comments on commit 5575eba

Please sign in to comment.