pathable / supermodel

Supermodel - Minimal Model Tracking for Backbonejs
http://pathable.github.io/supermodel
MIT License
229 stars 36 forks source link

Add Model.source for backend envelopes #41

Closed willmruzek closed 7 years ago

willmruzek commented 11 years ago

In certain situations, the model and its nested attributes are each served in their own envelope.

For example:

{
  'User': {
    id: 1,
    name: 'John'
  }
  'Document': {
    id: 35,
    title: 'Doc title',
    content: 'Doc content'
  }
}

This pull request adds Model.source that is used to return any remaining attributes after the associations have parsed them.

Simply, if source is provided and it's in the attributes, resp.source will be returned. Otherwise, just resp will be returned.

flippyhead commented 9 years ago

Apologies for the delay, can you remove all the extra fonts and CSS stuff that's not specifically related to the code change you propose? Thanks!

willmruzek commented 9 years ago

Huh, I completely forget why that's in the diff. I'll give it a look and update you when I've made the changes. Thanks!

willmruzek commented 9 years ago

It may have been part of the generated docs...