Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/datastore/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,21 @@ function Key(path) {
module.exports.Key = Key;

function Int(val) {
this.val = val;
this.val_ = val;
}

Int.prototype.get = function() {
return this.val;
return this.val_;
};

module.exports.Int = Int;

function Double(val) {
this.val = val;
this.val_ = val;
}

Double.prototype.get = function() {
return this.val;
return this.val_;
};

module.exports.Double = Double;
Expand Down
4 changes: 2 additions & 2 deletions lib/datastore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ module.exports = {
// TODO(jbd): Handle arguments in entity.Key constructor.
return new entity.Key([].slice.call(arguments));
},
Int: function(value) {
int: function(value) {
return new entity.Int(value);
},
Double: function(value) {
double: function(value) {
return new entity.Double(value);
}
};
4 changes: 2 additions & 2 deletions test/datastore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ describe('Datastore', function() {

it('should expose Int builder', function() {
var anInt = 7;
datastore.Int(anInt);
datastore.int(anInt);
assert.equal(entity.intCalledWith, anInt);
});

it('should expose Double builder', function() {
var aDouble = 7.0;
datastore.Double(aDouble);
datastore.double(aDouble);
assert.equal(entity.doubleCalledWith, aDouble);
});
});
2 changes: 1 addition & 1 deletion test/datastore/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('Query', function() {
it('should be converted to a query proto successfully', function(done) {
var q = ds.createQuery(['Kind'])
.select(['name', 'count'])
.filter('count >=', datastore.Int(5))
.filter('count >=', datastore.int(5))
.filter('name =', 'Burcu')
.order('-count')
.groupBy(['count'])
Expand Down