[MacRuby-devel] problems implementing a NSEntityMigrationPolicy? (fixed)
Michael Johnston
lastobelus at mac.com
Thu Jan 28 00:54:31 PST 2010
Actually this is working for me now. I did have a bug in my original
migration policy, and at some point in my regression I changed
something which resulted in my migration policy class not getting
loaded by the application and didn't notice because the reported error
was the same.
Cheerio,
Michael Johnston
lastobelus at mac.com
On 27-Jan-10, at 10:35 PM, Michael Johnston wrote:
> Hi,
>
> I'm having trouble implementing a NSEntityMigrationPolicy. Has
> anyone used subclasses of NSEntityMigrationPolicy in macruby
> successfully?
>
> I've narrowed it down to the empty macruby implementation, which
> looks like this:
>
> {{{
>
> class V3RecipeIngredientToIngredient < NSEntityMigrationPolicy
> def createDestinationInstancesForSourceInstance(source,
> entityMapping:mapping, manager:manager, error:error)
> return true
> end
>
> def createRelationshipsForDestinationInstance(dInstance,
> entityMapping:mapping, manager:manager, error:error)
> true
> end
> end
>
> }}}
>
> when I run this (and do a addPersistentStoreWithType with
> NSMigratePersistentStoresAutomaticallyOption) I get:
>
> #<Class:0x10145fc80>: An error occured during persistent store
> migration.
> userInfo: {"NSUnderlyingException"=>#<_NSCoreDataException:
> 0x8002d8840>}
>
> the _NSCoreDataException does not seem to have any message or other
> chain of errors.
>
> the corresponding Objective C empty implementation works fine:
>
> {{{
> - (BOOL)createDestinationInstancesForSourceInstance:
> (NSManagedObject*)source
> entityMapping:
> (NSEntityMapping*)mapping
> manager:
> (NSMigrationManager*)manager
> error:(NSError**)error
> {
> return YES;
> }
> }}}
>
> Is there any way to get more detail on how/why it is failing?
>
> Cheerio,
>
> Michael Johnston
> lastobelus at mac.com
>
>
>
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
More information about the MacRuby-devel
mailing list