Permalink
Browse files

No need to capture the results manually.

  • Loading branch information...
1 parent 1ec48b6 commit ccc10cdf87630dc789c7d380de5ea1ad16a59401 @alloy committed Jul 8, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 app/managed_object.rb
@@ -47,16 +47,14 @@ def property(name, type, options = {})
def all
scope = NSFetchRequest.new
scope.entity = entityDescription
- results = nil
# Encueing the fetch like this ensures other transactions on the context
# have been run.
#
# This is what MagicalRecord does too.
- Context.current.performBlockAndWait(lambda do
- results = Context.current.executeFetchRequest(scope, error:nil)
+ Context.current.perform do
+ Context.current.executeFetchRequest(scope, error:nil)
# TODO handleError(error) unless results
- end)
- results
+ end
end
end
end

0 comments on commit ccc10cd

Please sign in to comment.