New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sequelize.col() not working for ordering in findAll #1249

Closed
overlookmotel opened this Issue Jan 14, 2014 · 3 comments

Comments

2 participants
@overlookmotel
Contributor

overlookmotel commented Jan 14, 2014

The following code:

var Company = sequelize.define('Company', {
    name: Sequelize.STRING
});

Company.findAll({order: [sequelize.col('name')]})
    .done(function(err, result) {console.log(err)});

...throws error 'Unknown structure passed to order / group: {"col":"name"}'.

It works fine for Company.find(). Is it intentionally different for findAll()?

Sequelize 1.7.0-rc1, MySQL 5.6.14, Node 0.10.24, OS X 10.8.5

@mickhansen

This comment has been minimized.

Contributor

mickhansen commented Jan 14, 2014

Strange, this should definetely work. Or atleast i believe so :)

@overlookmotel

This comment has been minimized.

Contributor

overlookmotel commented Jan 14, 2014

options = optClone(options) in lib/dao-factory.js line 428 seems to strip the col object of being an instance of Utils.col

@mickhansen

This comment has been minimized.

Contributor

mickhansen commented Jan 16, 2014

@overlookmotel I see, i'll take a look at it this week. If you create a PR with a failing unit test for this i'll get it done faster ;)

@ghost ghost assigned mickhansen Jan 18, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment