Skip to content
This repository has been archived by the owner on Feb 28, 2020. It is now read-only.

Commit

Permalink
Cached entity descriptions: get only the last part of managedObjectCl…
Browse files Browse the repository at this point in the history
…assName for comparison
  • Loading branch information
vmartinelli committed Oct 18, 2016
1 parent 4cdb803 commit dc3f260
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Source/AlecrimCoreData/Core/Structs/Table.swift
Expand Up @@ -44,7 +44,11 @@ extension NSPersistentStoreCoordinator {
entityDescription = cachedEntityDescription
}
else {
entityDescription = self.managedObjectModel.entities.filter({ $0.managedObjectClassName == managedObjectClassName }).first!
entityDescription = self.managedObjectModel.entities
.filter {
$0.managedObjectClassName.components(separatedBy: ".").last! == managedObjectClassName }
.first!

self.cachedEntityDescriptions[managedObjectClassName] = entityDescription
}

Expand Down

0 comments on commit dc3f260

Please sign in to comment.