magicalpanda / MagicalRecord

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

Duplicated records using importFromObject with custom classes, even though relatedByAttribute is set correctly #1223

Open ricardopaiva opened 8 years ago

ricardopaiva commented 8 years ago

I'm using a library that receives a JSON file from a API and creates custom classes from JSON. I'm using the importFromObject to persist those custom classes (not NSDictionary) in Core Data and I'm having problems with duplicated records being created. After some debugging I've discovered an issue with MagicalRecord. With the changed in this pull request, the relationship defined in the model is respected and the object is not duplicated.

Please let me know if a sample project is needed.

Regards