superfeedr / indexeddb-backbonejs-adapter

An indexedDB adapter for Backbonejs
http://blog.superfeedr.com/indexeddb-backbonejs-adapter/
MIT License
248 stars 61 forks source link

Add compatibility for Backbone 1.0.0 #39

Closed rafeca closed 11 years ago

rafeca commented 11 years ago

Right now fetch() is not working on Backbone 1.0.0, this is due to changes in this commit: https://github.com/documentcloud/backbone/commit/6e646f1ba71dd889226a8f99f4d3e7e4ed2b706e

I could help creating a PR but as the tests are currently failing I don't feel confident enough

aaronpowell commented 11 years ago

I'm not a Backbone expert so I'm somewhat flying blind to try and fix this. By the looks of it the problem is that some of the time the database object are on the collection property of the object being passed around. Admittedly that may be my implementation problem but I'm still looking ;)

aaronpowell commented 11 years ago

The other problem I've found is that the success method from the query now expects only a single argument which is the data returned so line 568 should be changed from:

if (success) success(object, resp, options);

to:

if (success) success(resp);

But as I said I'm only just getting started with Backbone so I'm not 100% sure if this is the best/right way to approach things.

julien51 commented 11 years ago

@rafeca Hum. Failing tests? I had 2 commits that were not pushed... I just did that and all tests pass on Chrome 26.0.1410.65.

@aaronpowell Do you still see the problems you're mentioning?

Pull requests would be amazing as I'm running late on so many projects :/

aaronpowell commented 11 years ago

@julien51 like I said I'm somewhat muddling my way through it, my example is here. It's running the change that I outlined above.

Did you try upgrading your tests to use Backbone 1.0?

aaronpowell commented 11 years ago

Yeah I can confirm it's a problem with Backbone 1.0, upgraded locally and that caused it to fail. See PR #40 which will fix the bug

julien51 commented 11 years ago

Thanks! Merged :)