chaplinjs/chaplin — pull request #176 by tsareg (2012-09-05 14:57:52+00:00)
Title: Check instanceof Backbone.Model instead of Chaplin.Model in serializeAtt...

...ributes function

Hi, was there a particular reason to check there for Chaplin.Model instead of Backbone.Model?

Using Backbone.Model there will allow easier mixin of Chaplin.Model with other classes inherited from Backbone.Model.

For example, in my case:

Backbone.Model -> Backbone.RelationalModel (https://github.com/PaulUithol/Backbone-relational)
Backbone.Model -> Chaplin.Model

If I want to have Chaplin.RelationalModel, then I do it in following way:

```javascript
var RelationalModel = Backbone.RelationalModel.extend();

_.extend(RelationalModel.prototype, utils.getObjectWithOwnProperties(Chaplin.Model.prototype));

return RelationalModel;
```
where
```javascript
getObjectWithOwnProperties: function(obj) {
var props = {};

for (var prop in obj){
if (obj.hasOwnProperty(prop)) {
props[prop] = obj[prop];
}
}

return props;
}
```

So my RelationalModel will be of type Backbone.Model, but not of type Chaplin.Model, and serialization will work incorrectly.
The proposed change fixes this situation.