diff --git a/packages/mongo-livedata/mongo_driver.js b/packages/mongo-livedata/mongo_driver.js index 22556dbee0..1922570c4e 100644 --- a/packages/mongo-livedata/mongo_driver.js +++ b/packages/mongo-livedata/mongo_driver.js @@ -15,7 +15,7 @@ var Future = Npm.require(path.join('fibers', 'future')); var replaceNames = function (filter, thing) { if (typeof thing === "object") { if (_.isArray(thing)) { - return _.map(thing, _.partial(replaceNames, filter)); + return _.map(thing, _.bind(replaceNames, null, filter)); } var ret = {}; _.each(thing, function (value, key) { diff --git a/packages/mongo-livedata/mongo_livedata_tests.js b/packages/mongo-livedata/mongo_livedata_tests.js index 84efed85f1..948a7962bd 100644 --- a/packages/mongo-livedata/mongo_livedata_tests.js +++ b/packages/mongo-livedata/mongo_livedata_tests.js @@ -27,22 +27,24 @@ Meteor._FailureTestCollection = new Meteor.Collection("___meteor_failure_test_collection"); // For test "document with a custom type" -var Dog = function (name, color) { +var Dog = function (name, color, actions) { var self = this; self.color = color; self.name = name; + self.actions = actions || [{name: "wag"}, {name: "swim"}]; }; _.extend(Dog.prototype, { getName: function () { return this.name;}, getColor: function () { return this.name;}, equals: function (other) { return other.name === this.name && - other.color === this.color; }, - toJSONValue: function () { return {color: this.color, name: this.name};}, + other.color === this.color && + EJSON.equals(other.actions, this.actions);}, + toJSONValue: function () { return {color: this.color, name: this.name, actions: this.actions};}, typeName: function () { return "dog"; }, clone: function () { return new Dog(this.name, this.color); }, speak: function () { return "woof"; } }); -EJSON.addType("dog", function (o) { return new Dog(o.name, o.color);}); +EJSON.addType("dog", function (o) { return new Dog(o.name, o.color, o.actions);}); // Parameterize tests.