SteveSanderson/knockout.mapping — Issue #45: inner mapping options not respected
Author: jamesfoster
Created: 2012-01-17 15:20:36+00:00
State: open

See the following jsfiddle for an example of this problem.

http://jsfiddle.net/jamesfoster/HwGgH/

If I have the following object:

```
function Record(data) {
var self = this;

ko.mapping.fromJS(data, {
copy: ['id']
}, self);
}
```

when calling `ko.mapping.toJSON(record)` everything works as expected, but when the object is wrapped in some other context the `id` propery is missing

```
var viewModel = { record: new Record(...) };

ko.mapping.toJSON(viewModel) // id property is missing
ko.mapping.toJSON(viewModel.record) // works
```