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

Commit ff97ab70 by Sascha Depold

Merge branch 'master' into milestones/2.0.0

2 parents 4c276236 c2d59e20
......@@ -63,6 +63,7 @@
- [FEATURE] Blob support. janmeier
- [FEATURE] We can now define our own custom timestamp columns [#856](https://github.com/sequelize/sequelize/pull/856). thanks to durango
- [FEATURE] Scopes. [#748](https://github.com/sequelize/sequelize/pull/748). durango
- [FEATURE] Model#find() / Model#findAll() is now working with strings. [#855](https://github.com/sequelize/sequelize/pull/855). Thanks to whito.
- [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] Moved Jasmine to Buster and then Buster to Mocha + Chai. sdepold and durango
......
......@@ -105,7 +105,7 @@ module.exports = (function() {
this.primaryKeys = {};
Utils._.each(this.attributes, function(dataTypeString, attributeName) {
if ((attributeName !== 'id') && (dataTypeString.indexOf('PRIMARY KEY') !== -1)) {
if (dataTypeString.indexOf('PRIMARY KEY') !== -1) {
self.primaryKeys[attributeName] = dataTypeString
}
})
......
......@@ -1554,6 +1554,28 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
})
})
it('finds entries via a string primary key called id', function(done) {
var self = this
, UserPrimary = self.sequelize.define('UserWithPrimaryKey', {
id: {type: Sequelize.STRING, primaryKey: true},
name: Sequelize.STRING
})
UserPrimary.sync({ force: true }).success(function() {
UserPrimary.create({
id: 'a string based id',
name: 'Johnno'
}).success(function(u) {
UserPrimary.find('a string based id').success(function(u2) {
expect(u2.id).to.equal('a string based id')
expect(u2.name).to.equal('Johnno')
done()
})
})
})
})
it('returns the selected fields as instance.selectedValues', function(done) {
var self = this
this.User.create({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!