diff --git a/lib/remote-connector.js b/lib/remote-connector.js index 624ee31..848c9d5 100644 --- a/lib/remote-connector.js +++ b/lib/remote-connector.js @@ -40,7 +40,7 @@ function RemoteConnector(settings) { // handle mixins in the define() method var DAO = this.DataAccessObject = function() { }; - + } RemoteConnector.prototype.connect = function() { @@ -77,6 +77,11 @@ RemoteConnector.prototype.resolve = function(Model) { createProxyMethod(Model, remotes, remoteMethod); } }); + + // setup a remoting type converter for this model + remotes.defineType(Model.modelName, function(val) { + return val ? new Model(val) : val; + }); }; function createProxyMethod(Model, remotes, remoteMethod) {