Rightpoint / RZVinyl

Stack management, ActiveRecord utilities, and seamless importing for Core Data
Other
21 stars 6 forks source link

Remove context from RZImportable instance methods #75

Closed KingOfBrian closed 8 years ago

KingOfBrian commented 8 years ago

Since we're changing API's, this PR removes a simple difference between NSManagedObject RZImport and NSObject RZImport. It drops instance methods that have a context supplied. This is not needed because self.managedObjectContext is always present (with the exception of a few weird delete cases).

This is the first step in removing the differences between RZImport for NSManagedObject and NSObject. I don't see many reasons to object to this change, but the other removals will be more opinionated, so I've separated them into another PR.

alexrrouse commented 8 years ago

@KingOfBrian A great simplification. +1 for this.

jwatson commented 8 years ago

@KingOfBrian looks good to merge.

Partial aside: I'm wondering if it makes sense to keep the background context private or not. If it were public, we could avoid calling performBlockUsingBackgroundContext: and just call context.performImport: directly. The downside I guess is that we'd be dirtying the top level background context instead of an ephemeral child context, and would have to do a rollback on error.

nbonatsakis commented 8 years ago

@KingOfBrian looks good to me too.