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

Commit 11c875e0 by Sascha Depold

Merge branch 'master' into milestones/2.0.0

2 parents a5e67f74 d11da684
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
- [FEATURE] Shortcut method for getting a defined model. [#868](https://github.com/sequelize/sequelize/pull/868). Thanks to jwilm. - [FEATURE] Shortcut method for getting a defined model. [#868](https://github.com/sequelize/sequelize/pull/868). Thanks to jwilm.
- [FEATURE] Added Sequelize.fn() and Sequelize.col() to properly call columns and functions within Sequelize. [#882](https://github.com/sequelize/sequelize/pull/882). thanks to janmeier - [FEATURE] Added Sequelize.fn() and Sequelize.col() to properly call columns and functions within Sequelize. [#882](https://github.com/sequelize/sequelize/pull/882). thanks to janmeier
- [FEATURE] Sequelize.import supports relative paths. [#901](https://github.com/sequelize/sequelize/pull/901). thanks to accerqueira. - [FEATURE] Sequelize.import supports relative paths. [#901](https://github.com/sequelize/sequelize/pull/901). thanks to accerqueira.
- [FEATURE] Sequelize.import can now handle functions. [#911](https://github.com/sequelize/sequelize/pull/911). Thanks to davidrivera.
- [REFACTORING] hasMany now uses a single SQL statement when creating and destroying associations, instead of removing each association seperately [690](https://github.com/sequelize/sequelize/pull/690). Inspired by [#104](https://github.com/sequelize/sequelize/issues/104). janmeier - [REFACTORING] hasMany now uses a single SQL statement when creating and destroying associations, instead of removing each association seperately [690](https://github.com/sequelize/sequelize/pull/690). Inspired by [#104](https://github.com/sequelize/sequelize/issues/104). janmeier
- [REFACTORING] Consistent handling of offset across dialects. Offset is now always applied, and limit is set to max table size of not limit is given [#725](https://github.com/sequelize/sequelize/pull/725). janmeier - [REFACTORING] Consistent handling of offset across dialects. Offset is now always applied, and limit is set to max table size of not limit is given [#725](https://github.com/sequelize/sequelize/pull/725). janmeier
- [REFACTORING] Moved Jasmine to Buster and then Buster to Mocha + Chai. sdepold and durango - [REFACTORING] Moved Jasmine to Buster and then Buster to Mocha + Chai. sdepold and durango
......
...@@ -227,7 +227,7 @@ module.exports = (function() { ...@@ -227,7 +227,7 @@ module.exports = (function() {
} }
if (!this.importCache[path]) { if (!this.importCache[path]) {
var defineCall = require(path) var defineCall = (arguments.length > 1 ? arguments[1] : require(path))
this.importCache[path] = defineCall(this, DataTypes) this.importCache[path] = defineCall(this, DataTypes)
} }
......
...@@ -377,12 +377,18 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () { ...@@ -377,12 +377,18 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () {
describe('import', function() { describe('import', function() {
it("imports a dao definition from a file absolute path", function(done) { it("imports a dao definition from a file absolute path", function(done) {
var Project = this.sequelize.import(__dirname + "/assets/project") var Project = this.sequelize.import(__dirname + "/assets/project")
expect(Project).to.exist expect(Project).to.exist
done() done()
}) })
it("imports a dao definition from a file relative path", function(done) { it("imports a dao definition from a function", function(done) {
var Project = this.sequelize.import("assets/project") var Project = this.sequelize.import('Project', function(sequelize, DataTypes) {
return sequelize.define('Project' + parseInt(Math.random() * 9999999999999999), {
name: DataTypes.STRING
})
})
expect(Project).to.exist expect(Project).to.exist
done() done()
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!