不要怂,就是干,撸起袖子干!

Commit f2eca756 by Sascha Depold

Merge branch 'fixIssue494' of git://github.com/solotimes/sequelize into solotimes-fixIssue494

2 parents ecd3de33 e9113f35
Showing with 16 additions and 0 deletions
...@@ -287,6 +287,9 @@ module.exports = (function() { ...@@ -287,6 +287,9 @@ module.exports = (function() {
, self = this , self = this
Utils._.each(this.values, function(value, key) { Utils._.each(this.values, function(value, key) {
if(Utils._.isDate(value) && Utils._.isDate(other[key]))
result = result && (value.getTime() == other[key].getTime())
else
result = result && (value == other[key]) result = result && (value == other[key])
}) })
......
...@@ -409,4 +409,17 @@ describe(Helpers.getTestDialectTeaser("DAO"), function() { ...@@ -409,4 +409,17 @@ describe(Helpers.getTestDialectTeaser("DAO"), function() {
}.bind(this)) }.bind(this))
}) })
}) })
describe('equals', function find() {
it("can compare records with Date field", function(done) {
this.User.create({ username: 'fnord' }).success(function(user1) {
var query = { where: { username: 'fnord' }}
this.User.find(query).success(function(user2) {
expect(user1.equals(user2)).toEqual(true)
done()
}.bind(this))
}.bind(this))
})
})
}) })
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!