xavierlacot/joli.js — Issue #16: Migration problem
Author: jamesDin
Created: 2011-12-16 08:57:10+00:00
State: open

First of all, I love your work !!! You really did a great job.

I tried your demo, and you have a line there that suppose to do "migrate" to database:

joli.models.migrate(current_migration_version);

Actually, it runs ONLY on the first time, when the emulator/device is cleared. On the second time when I run it again, it gives an error on line 600 (joli.js).
I checked it out and seems to be that after calling the next line:

// use the model specified by as() first, then from()
var model = joli.models.get(this.data.as || this.data.from);

the "model" is null.
Then it fails on line 600:

result.push(model.newRecord().fromArray(rowData));

When I comment the "migrate", line, the application works fine. But if joli can do this, it will be simply just great!

Thanks a lot.