Skip to content
This repository was archived by the owner on Apr 22, 2021. It is now read-only.
This repository was archived by the owner on Apr 22, 2021. It is now read-only.

backbonejs version compatibility (backbonejs 1.1) #50

@fluxsaas

Description

@fluxsaas

Hey,

just notices a broken behavior after upgrading to backbone version 1.1

backbone throws the error Uncaught TypeError: Cannot read property 'cid' of undefined

on line:

https://github.com/jashkenas/backbone/blob/master/backbone.js#L721

after debugging a while i found that fetching records with model.associated_models().fetch() throws this error, after executing 3-4 times :)

it seems that supermodel just adds model after fetching (calling model.associated_models().length shows doubled length after each call) instead of replacing/resetting.

it seems that the new backbone functionality:

If you want to smartly update the contents of a Collection, adding new models, 
removing missing ones, and merging those already present, you now call set 
(previously named "update"), a similar operation to calling set on a Model. This is now 
the default when you call fetch on a collection. To get the old behavior, 
pass {reset: true}.

http://backbonejs.org/#upgrading

breaks supermodel.

i haven't found the right fix for supermodel yet. i gonna try :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions