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

Commit 04b237e7 by Mick Hansen Committed by Thanasis Polychronakis

consistency

1 parent 66fabc40
...@@ -119,7 +119,7 @@ module.exports = (function() { ...@@ -119,7 +119,7 @@ module.exports = (function() {
} else { } else {
this.as = Utils.pluralize(this.target.name, this.target.options.language) this.as = Utils.pluralize(this.target.name, this.target.options.language)
} }
this.accessors = { this.accessors = {
get: Utils._.camelize('get_' + this.as), get: Utils._.camelize('get_' + this.as),
set: Utils._.camelize('set_' + this.as), set: Utils._.camelize('set_' + this.as),
...@@ -195,7 +195,7 @@ module.exports = (function() { ...@@ -195,7 +195,7 @@ module.exports = (function() {
if (primaryKeyDeleted) { if (primaryKeyDeleted) {
targetAttribute.primaryKey = sourceAttribute.primaryKey = true targetAttribute.primaryKey = sourceAttribute.primaryKey = true
} else { } else {
var uniqueKey = [this.through.tableName, this.identifier, this.foreignIdentifier, 'unique'].join('_') var uniqueKey = [this.through.tableName, this.identifier, this.foreignIdentifier, 'unique'].join('_')
targetAttribute.unique = sourceAttribute.unique = uniqueKey targetAttribute.unique = sourceAttribute.unique = uniqueKey
} }
......
...@@ -627,7 +627,7 @@ describe(Support.getTestDialectTeaser("HasMany"), function() { ...@@ -627,7 +627,7 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
username: DataTypes.STRING username: DataTypes.STRING
}).schema('acme', '_') }).schema('acme', '_')
, AcmeProject = self.sequelize.define('Project', { , AcmeProject = self.sequelize.define('Project', {
title: DataTypes.STRING, title: DataTypes.STRING,
active: DataTypes.BOOLEAN active: DataTypes.BOOLEAN
}).schema('acme', '_') }).schema('acme', '_')
, AcmeProjectUsers = self.sequelize.define('ProjectUsers', { , AcmeProjectUsers = self.sequelize.define('ProjectUsers', {
...@@ -835,7 +835,7 @@ describe(Support.getTestDialectTeaser("HasMany"), function() { ...@@ -835,7 +835,7 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
this.Task.hasMany(this.User) this.Task.hasMany(this.User)
this.sequelize.sync({force: true}).success(function() { this.sequelize.sync({force: true}).success(function() {
done() done()
}) })
}) })
...@@ -938,7 +938,7 @@ describe(Support.getTestDialectTeaser("HasMany"), function() { ...@@ -938,7 +938,7 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
}) })
}) })
}) })
describe('primary key handling for join table', function () { describe('primary key handling for join table', function () {
beforeEach(function (done) { beforeEach(function (done) {
var self = this var self = this
...@@ -966,7 +966,7 @@ describe(Support.getTestDialectTeaser("HasMany"), function() { ...@@ -966,7 +966,7 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
it('keeps the primary key if it was added by the user', function () { it('keeps the primary key if it was added by the user', function () {
var self = this var self = this
, fk , fk
this.UserTasks = this.sequelize.define('usertasks', { this.UserTasks = this.sequelize.define('usertasks', {
id: { id: {
type: Sequelize.INTEGER, type: Sequelize.INTEGER,
...@@ -980,14 +980,14 @@ describe(Support.getTestDialectTeaser("HasMany"), function() { ...@@ -980,14 +980,14 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
autoincrement: true, autoincrement: true,
primaryKey: true primaryKey: true
} }
}); });
this.User.hasMany(this.Task, { through: this.UserTasks }) this.User.hasMany(this.Task, { through: this.UserTasks })
this.Task.hasMany(this.User, { through: this.UserTasks }) this.Task.hasMany(this.User, { through: this.UserTasks })
this.User.hasMany(this.Task, { through: this.UserTasks2 }) this.User.hasMany(this.Task, { through: this.UserTasks2 })
this.Task.hasMany(this.User, { through: this.UserTasks2 }) this.Task.hasMany(this.User, { through: this.UserTasks2 })
expect(Object.keys(self.UserTasks.primaryKeys)).to.deep.equal(['id']) expect(Object.keys(self.UserTasks.primaryKeys)).to.deep.equal(['id'])
expect(Object.keys(self.UserTasks2.primaryKeys)).to.deep.equal(['userTasksId']) expect(Object.keys(self.UserTasks2.primaryKeys)).to.deep.equal(['userTasksId'])
...@@ -997,7 +997,7 @@ describe(Support.getTestDialectTeaser("HasMany"), function() { ...@@ -997,7 +997,7 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
}) })
}) })
}) })
describe('through', function () { describe('through', function () {
beforeEach(function (done) { beforeEach(function (done) {
this.User = this.sequelize.define('User', {}) this.User = this.sequelize.define('User', {})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!