Incorrect NSManagedObjectContext used in MR_requestAllSortedBy #294

JubblerJr opened this Issue Nov 1, 2012 · 0 comments

2 participants


Came across a slight issue in the following method

+ (NSFetchRequest *) MR_requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context

Rather than execute against the passed in NSManagedObjectContext it is using [NSManagedObjectContext MR_contextForCurrentThread]

So it should read

    return [self MR_requestAllSortedBy:sortTerm

rather than

    return [self MR_requestAllSortedBy:sortTerm
                         inContext:[NSManagedObjectContext MR_contextForCurrentThread]];
@marcin-zbijowski marcin-zbijowski pushed a commit to marcin-zbijowski/MagicalRecord that referenced this issue Nov 5, 2012
Marcin Zbijowski Merge remote-tracking branch 'upstream/master'
* upstream/master:
  Bumping podspec version
  Fixed Issue #294 - MR_requestAllSortedBy:ascending:inContext: did not use correct context
  Added fetchAllWithDelegate: method for NSFRC
  Separate printing context chain method into its own method change contextWorkingName to property workingName
  removed MR_saveErrorHandler, as it and MR_saveWithErrorCallback were essentially duplicates MR_save now only saves the current context (it was essentially doing a MR_saveNestedContexts). If you need to save all the way out to disk, use MR_saveNestedContexts. Removed the action queue, unneccesary since core data introduced it's own queue support
  don't check the error, rely only on the return value of methods to determine success
  Cleanup contextWillSave method Update deleting incompatible store
  Adding changelog
  Fixed issue #287 - MR_findByAttribute:withValue:andOrderBy:ascending:inContext does not pass context through
  Bumped podspec to 2.0.7
  Test that the current thread saveWith method actually saves
  saveWithBlock was not saving parent contexts
  Rolled back a commit that broke things if cleanup was used. It created the action_queue in a dispatch_once block, and never recreated it after a cleanup
  Cherry picking changes that make the context description more... descriptive
  Fixing potential concurrency issue with creating the actionQueue
  Properly removing existing on-save notificaitons before replacing the default or root contexts
  Bump tag to 2.0.6
  Require ARC in podspec (was compiling with retain/release in pod installations)
  Fixed KVC relationship mapping bug.
@blackgold9 blackgold9 closed this Nov 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment