magicalpanda / MagicalRecord

Super Awesome Easy Fetching for Core Data!
Other
10.8k stars 1.79k forks source link

Importing 'NSNull' for relationship sets its value to 'nil' instead of ignoring it. #1371

Closed Coeur closed 5 years ago

Coeur commented 5 years ago

Same as #1194, with a minimal unit test added. Quoting @AnthonyMDev:

If imported data does not include the key for a relationship, the relationship should be skipped. However, if the imported data does include the key with a value of null (NSNull), the relationship should still be imported, setting the value to nil.

In the event of a null value, the shouldImportValue: and importValue: selectors are called, passing the value NSNull, allowing the handling of a null value for a key to be overridden.