Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for backbone 0.9.9 #59

Open
dwt opened this issue Dec 21, 2012 · 1 comment
Open

Add support for backbone 0.9.9 #59

dwt opened this issue Dec 21, 2012 · 1 comment

Comments

@dwt
Copy link

dwt commented Dec 21, 2012

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
@paulkoegel
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants