- 31 May, 2013 2 commits
-
-
Sascha Depold committed
-
Sascha Depold committed
-
- 30 May, 2013 7 commits
-
-
Fixing a bug in query generation where 'identifier' is being stored as the raw value of the 'id' rather than being wrapped in an object.
Sascha Depold committed -
When the raw value of ```id``` is stored as ```identifier``` in ```save()``` an invalid query is returned from the ```QueryGenerator```. i.e. - Without the fix, an UPDATE query looks like this: ```UPDATE `Users` SET `gender`='male',`email`='updated@bar.com',`updatedAt`='2013-05-29 23:33:36',`createdAt`='2013-05-29 23:33:36' WHERE 2``` The ```WHERE 2``` is not the desired behavior. If ```id``` is wrapped in an object then the correct query is generated: ```UPDATE `Users` SET `gender`='male',`email`='updated@bar.com',`updatedAt`='2013-05-29 23:33:36',`createdAt`='2013-05-29 23:33:36' WHERE `id`=2```
Elliot Chong committed -
Sascha Depold committed
-
Sascha Depold committed
-
Sascha Depold committed
-
Sascha Depold committed
-
Sascha Depold committed
-
- 29 May, 2013 4 commits
-
-
Jan Aagaard Meier committed
-
Jan Aagaard Meier committed
-
PostgreSQL will no longer try to split regclass identifiers for default values.
Jan Aagaard Meier committed -
Added special field for describing tables with Postgres, this will give us ...
Jan Aagaard Meier committed
-
- 27 May, 2013 1 commit
-
-
Sascha Depold committed
-
- 26 May, 2013 3 commits
-
-
findOrCreate returns additional flag to tell whether the entry was found or created
Sascha Depold committed -
Jan Aagaard Meier committed
-
Jan Aagaard Meier committed
-
- 25 May, 2013 2 commits
-
-
…NUM values directly, also made a array conversion tool for postgres' querygenerator.
Daniel Durante committed -
Daniel Durante committed
-
- 24 May, 2013 9 commits
-
-
Sascha Depold committed
-
Sascha Depold committed
-
Sascha Depold committed
-
Add model validations option
Sascha Depold committed -
Plus a test for that
Bart Nagel committed -
Also add a test for it
Bart Nagel committed -
Instead of a hash called __model with the model validation errors, the model validation errors are now alongside the field validation keys of the hash, named after the validation's key in the validate array. To be as consistent as possible, the value is an array even though it will only ever have one member. The structure is set to change in 2.0. Example: where there was a model validation set up like validate: { xnor: function() { if (this.field1 === null) === (this.field2 === null) { throw new Error('require both or neither') } } } and field1 and field2 have some validations, validate() might return something like { field1: [ 'must be an email address', 'email address must be @example.com' ], xnor: ['require both or neither'] }
Bart Nagel committed -
Bart Nagel committed
-
Bart Nagel committed
-
- 23 May, 2013 2 commits
-
-
Daniel Durante committed
-
Added DOA Getters and Setters
durango committed
-
- 22 May, 2013 8 commits
-
-
As discussed on IRC. Also add task for 2.0 to change the validate() output structure.
Bart Nagel committed -
The existing but unused (as far as I could tell) DAO option `validate` can now have member methods which will be called with the model object's context after the other (field-specific) validations. Only custom functions are allowed (since isInt etc wouldn't make sense in this context). As with other custom validations, they are deemed to pass if they throw no error, or fail if an error is thrown. Any error messages collected are added to a '_' member array of the validation result object, alongside the arrays named after any fields whose validations failed. Example: var Pub = Sequelize.define('Pub', { name: { type: Sequelize.STRING }, address: { type: Sequelize.STRING }, latitude: { type: Sequelize.INTEGER, allowNull: true, defaultValue: null, validate: { min: -90, max: 90 } }, longitude: { type: Sequelize.INTEGER, allowNull: true, defaultValue: null, validate: { min: -180, max: 180 } }, }, { validate: { xorCoords: function() { if ((this.latitude === null) === (this.longitude === null)) { throw new Error('Require either both latitude and longitude or neither') } } } }) In this simple case an object fails validation if latitude or longitude is given, but not both. If we try to build one with an out of range latitude and no longitude, `raging_bullock_arms.validate()`, might return { 'latitude': ['Invalid number: latitude'], '_': ['Require either both latitude and longitude or neither'] } A test is included.
Bart Nagel committed -
Sascha Depold committed
-
SQLite addQuotes is not correct
Jan Aagaard Meier committed -
Sascha Depold committed
-
Enable the override of the default attributes
Sascha Depold committed -
Provide a link to a live sandbox environment where sequelizse examples are available
Sascha Depold committed -
…mysql dialect query generator
Michael Weibel committed
-
- 21 May, 2013 1 commit
-
-
sevastos committed
-
- 20 May, 2013 1 commit
-
-
Sascha Depold committed
-