PaulUithol/Backbone-relational — pull request #163 by emilecantin (2012-07-11 20:54:24+00:00)
Title: Make 'MyModel.setup()' return 'MyModel'

When using RequireJS and CoffeeScript, you may see code like this:

```coffeescript
define (require)->
Backbone = require 'backbone'
require 'backbone-relational'

class MyModel extends Backbone.RelationalModel

relations: [
# etc...
]
```
RequireJS / AMD works by passing a callback to the "define" function that returns the module. The above code returns the "MyModel" constructor function because of CoffeeScript's "everything is an expression" philosophy.
Adding `MyModel.setup()` at the end, as specified in the documentation, breaks this functionality.
A simple `return this;` at the end of "MyModel.setup()" fixes this.