cayasso/oomvc — Issue #25: BUG: connection key's not supported in response object
Author: noctivityinc
Created: 2011-11-04 20:47:48+00:00
State: open
Labels: Bug

When I have a connection key that is different than the model name, for example:

```
(function(Model){

Model.Foo = Model.Extension.extend('Foo', {

schema: {
...
},

connection: {
key: 'goal',
...	}
}
);

})(Lowes.My.Model);
```

and I then do a find or try to interact with that model:

```
Foo.find(id, function(res) {
var foo = res.foo;
}
```

it crashes since the response object does not have a record object for foo, it only has the response from the server (I dont believe it's a JSOOP record object) for the connection key, in this case goals.

A test case for this issue has been created called *alternativeConnectionKey* in controllers.js. You will also need

https://github.com/cayasso/oomvc/blob/master/GoalFoo.js and
https://github.com/cayasso/oomvc/blob/master/TaskBar.js and the updated
https://github.com/cayasso/oomvc/blob/master/example/test/index.html