Open 14lox opened 8 years ago
I have my shouldImport setup like this
shouldImport
override func shouldImport(data: AnyObject?) -> Bool { guard let account = data as? [NSObject: AnyObject] else { return false } guard let active = account["active"] as? Bool else { return false } return active }
so it only adds active accounts If I run MR_importFromArray
MR_importFromArray
MagicalRecord.saveWithBlock({ (context) -> Void in user.accounts = Set(Account.MR_importFromArray(accounts, inContext: context)) })
The inactive Account's are still being created inside MR_importFromArray but with nil attributes.
Account
nil
I have my
shouldImport
setup like thisso it only adds active accounts If I run
MR_importFromArray
The inactive
Account
's are still being created insideMR_importFromArray
but withnil
attributes.