* @param {Object} [options] A hash of options to describe the scope of the search
* @param {Object} [options.where] A hash of attributes to describe your search. See above for examples.
* @param {Array<String>} [options.attributes] A list of the attributes that you want to select
* @param {Array<String>} [options.attributes] A list of the attributes that you want to select. To rename an attribute, you can pass an array, with two elements - the first is the name of the attribute in the DB (or some kind of expression such as `Sequelize.literal`, `Sequelize.fn` and so on), and the second is the name you want the attribute to have in the returned instance
* @param {Array<Object|Model>} [options.include] A list of associations to eagerly load using a left join. Supported is either `{ include: [ Model1, Model2, ...]}` or `{ include: [{ model: Model1, as: 'Alias' }]}`. If your association are set up with an `as` (eg. `X.hasMany(Y, { as: 'Z }`, you need to specify Z in the as attribute when eager loading Y).
* @param {Model} [optinos.include[].model] The model you want to eagerly load
* @param {String} [options.include[].as] The alias of the relation, in case the model you want to eagerly load is aliassed.
someProperty:Sequelize.VIRTUAL,// Since we specify the AS part as a part of the literal string, not with sequelize syntax, we have to tell sequelize about the field
@@ -256,6 +256,26 @@ describe(Support.getTestDialectTeaser("Model"), function () {
});
});
});
it('should support renaming of sequelize method fields',function(){
varUser=this.sequelize.define('user',{
someProperty:Sequelize.VIRTUAL// Since we specify the AS part as a part of the literal string, not with sequelize syntax, we have to tell sequelize about the field