mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-26 19:31:29 +01:00
Merge branch 'prototype/Swift_3_2' into prototype/Swift_4_0
This commit is contained in:
@@ -401,13 +401,14 @@ internal extension Collection where Iterator.Element == SelectTerm {
|
|||||||
return entity.attributesByName[components[0]]
|
return entity.attributesByName[components[0]]
|
||||||
|
|
||||||
default:
|
default:
|
||||||
guard let relationship = entity.relationshipsByName[components[0]] else {
|
guard let relationship = entity.relationshipsByName[components[0]],
|
||||||
|
let destinationEntity = relationship.destinationEntity else {
|
||||||
return nil
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
return attributeDescription(
|
return attributeDescription(
|
||||||
for: components.dropFirst().joined(separator: "."),
|
for: components.dropFirst().joined(separator: "."),
|
||||||
in: relationship.entity
|
in: destinationEntity
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -418,18 +419,7 @@ internal extension Collection where Iterator.Element == SelectTerm {
|
|||||||
switch term {
|
switch term {
|
||||||
|
|
||||||
case ._attribute(let keyPath):
|
case ._attribute(let keyPath):
|
||||||
let entityDescription = fetchRequest.entity!
|
propertiesToFetch.append(keyPath)
|
||||||
if let attributeDescription = attributeDescription(for: keyPath, in: entityDescription) {
|
|
||||||
|
|
||||||
propertiesToFetch.append(attributeDescription)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
CoreStore.log(
|
|
||||||
.warning,
|
|
||||||
message: "The key path \"\(keyPath)\" could not be resolved in entity \(cs_typeName(entityDescription.managedObjectClassName)) as an attribute and will be ignored by \(cs_typeName(owner)) query clause."
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
case ._aggregate(let function, let keyPath, let alias, let nativeType):
|
case ._aggregate(let function, let keyPath, let alias, let nativeType):
|
||||||
let entityDescription = fetchRequest.entity!
|
let entityDescription = fetchRequest.entity!
|
||||||
|
|||||||
Reference in New Issue
Block a user