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

Commit 42e6cb5a by Mick Hansen

fixes

1 parent f4cb4405
......@@ -126,7 +126,7 @@ module.exports = (function() {
return Promise.all(promises).then(function(results) {
var promises = []
, instanceTable = self.sequelize.instanceFactoryManager.instances.filter(function(instance) { return instance.tableName === tableName; })
, instanceTable = self.sequelize.modelManager.instances.filter(function(instance) { return instance.tableName === tableName; })
, enumIdx = 0;
instanceTable = instanceTable.length > 0 ? instanceTable[0] : null;
......
......@@ -19,7 +19,7 @@ if (Support.dialectIsMySQL()) {
Table2.belongsToMany(Table1, { through: 'wp_table1swp_table2s' });
return Table1.sync({ force: true }).then(function() {
return Table2.sync({ force: true }).then(function() {
expect(self.sequelize.modelManager.getDAO('wp_table1swp_table2s')).to.exist;
expect(self.sequelize.modelManager.getModel('wp_table1swp_table2s')).to.exist;
});
});
});
......@@ -38,8 +38,8 @@ if (Support.dialectIsMySQL()) {
});
it('should not use only a specified name', function() {
expect(this.sequelize.modelManager.getDAO('ms_table1sms_table2s')).not.to.exist;
expect(this.sequelize.modelManager.getDAO('table1_to_table2')).to.exist;
expect(this.sequelize.modelManager.getModel('ms_table1sms_table2s')).not.to.exist;
expect(this.sequelize.modelManager.getModel('table1_to_table2')).to.exist;
});
});
});
......@@ -74,7 +74,7 @@ if (Support.dialectIsMySQL()) {
});
});
describe('addDAO / getDAO', function() {
describe('addDAO / getModel', function() {
beforeEach(function() {
var self = this;
......
......@@ -19,7 +19,7 @@ if (dialect.match(/^postgres/)) {
Table1.belongsToMany(Table2, { through: 'wp_table1swp_table2s' });
Table2.belongsToMany(Table1, { through: 'wp_table1swp_table2s' });
expect(this.sequelize.daoFactoryManager.getModel('wp_table1swp_table2s')).to.exist;
expect(this.sequelize.modelManager.getModel('wp_table1swp_table2s')).to.exist;
});
});
......@@ -33,11 +33,11 @@ if (dialect.match(/^postgres/)) {
});
it('should not use a combined name', function() {
expect(this.sequelize.daoFactoryManager.getModel('ms_table1sms_table2s')).not.to.exist;
expect(this.sequelize.modelManager.getModel('ms_table1sms_table2s')).not.to.exist;
});
it('should use the specified name', function() {
expect(this.sequelize.daoFactoryManager.getModel('table1_to_table2')).to.exist;
expect(this.sequelize.modelManager.getModel('table1_to_table2')).to.exist;
});
});
});
......
......@@ -64,7 +64,7 @@ if (dialect !== 'sqlite') {
return TimezonedUser.create({});
}).then(function(timezonedUser) {
this.timezonedUser = timezonedUser;
return NormalUser.find(timezonedUser.id);
return NormalUser.findById(timezonedUser.id);
}).then(function(normalUser) {
// Expect 5 hours difference, in milliseconds, +/- 1 hour for DST
expect(normalUser.createdAt.getTime() - this.timezonedUser.createdAt.getTime()).to.be.closeTo(60 * 60 * 4 * 1000 * -1, 60 * 60 * 1000);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!