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

Commit 77d80a9d by sdepold

fixed date parser

1 parent c40ac4f2
...@@ -82,7 +82,7 @@ module.exports = (function() { ...@@ -82,7 +82,7 @@ module.exports = (function() {
withoutEquals: false withoutEquals: false
}, options || {}) }, options || {})
var date = Migration.parseFilename(dateString.toString()).date var date = Migration.parseFilename(dateString.toString() + '-foo.js').date
return options.withoutEqual ? (date > this.date) : (date >= this.date) return options.withoutEqual ? (date > this.date) : (date >= this.date)
} }
...@@ -92,7 +92,7 @@ module.exports = (function() { ...@@ -92,7 +92,7 @@ module.exports = (function() {
withoutEquals: false withoutEquals: false
}, options || {}) }, options || {})
var date = Migration.parseFilename(dateString.toString()).date var date = Migration.parseFilename(dateString.toString() + '-foo.js').date
return options.withoutEqual ? (date < this.date) : (date <= this.date) return options.withoutEqual ? (date < this.date) : (date <= this.date)
} }
......
...@@ -91,7 +91,7 @@ describe('Migrator', function() { ...@@ -91,7 +91,7 @@ describe('Migrator', function() {
setup() setup()
Helpers.async(function(done) { Helpers.async(function(done) {
SequelizeMeta.create({ from: null, to: '20111117063700' }).success(function() { SequelizeMeta.create({ from: null, to: 20111117063700 }).success(function() {
migrator.getUndoneMigrations(function(err, migrations) { migrator.getUndoneMigrations(function(err, migrations) {
expect(err).toBeNull() expect(err).toBeNull()
expect(migrations.length).toEqual(6) expect(migrations.length).toEqual(6)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!