documentcloud/backbone — Issue #1069: Model#fetch should reset attributes, not append them.
Author: ashtuchkin
Created: 2012-03-05 18:10:42+00:00
State: open

When you do ```fetch``` on a model, it will ```set``` the object it gets from server to the model. Which is AFAIK incorrect, because it appends attributes to model, not replaces them. Please see an example (in coffee, live here http://jsfiddle.net/CRwHU/ ):

```
class Model extends Backbone.Model
sync: (method, model, options) ->
serverRepresentation = {b: 2}
options.success(serverRepresentation, "success")

m = new Model {a: 1}

$("

").text(JSON.stringify(m)).appendTo(".output")

m.fetch()

$("

").text(JSON.stringify(m)).appendTo(".output")

```

In my opinion, it should give

```

{"a":1}
{"b":2}

```

whereas currently it prints:

```

{"a":1}
{"a":1,"b":2}

```

Is it the expected behavior?