janmonschke / backbone-couchdb

A couchdb connector for backbone with support for real time changes.

Home Page:http://janmonschke.com/projects/backbone-couchdb.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for backbone 0.9.9

dwt opened this issue · comments

At least the override of Model::clone is broken at https://github.com/janmonschke/backbone-couchdb/blob/master/backbone-couchdb.js#L298 where is should use this.attributes as 0.9.9 is more strict about the arguments it takes for the constructor.

More might be broken - but thats what we found in a quick survey.

Our workaround:

Backbone.Model::clone = ->
  new_model = new @constructor(@attributes)
  if new_model.attributes._id
    delete new_model.attributes._id
  if new_model.attributes._rev
    delete new_model.attributes._rev
  new_model