Skip to content

Commit

Permalink
Our version of underscore doesn't have 'partial' anymore since we
Browse files Browse the repository at this point in the history
downgraded.

Missed one instance of this because I missed arrays in the EJSON support in
mongo testing.
  • Loading branch information
Naomi Seyfer authored and n1mmy committed May 14, 2013
1 parent 9b74af5 commit bc2be8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/mongo-livedata/mongo_driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 6 additions & 4 deletions packages/mongo-livedata/mongo_livedata_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit bc2be8b

Please sign in to comment.