Skip to content
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

Return orders as an array instead of a string #32

Merged
merged 2 commits into from
Jul 4, 2016

Conversation

jdurand
Copy link
Contributor

@jdurand jdurand commented Jul 15, 2015

Joining the order clauses caused non-string clauses (Arel nodes) to be appended as a string :

Model.order(featured: :desc).order_by_rand(seed: session[:order_seed])
=>
[...] ORDER BY #<Arel::Nodes::Descending:0x007fe60af66858>, (SUBSTR(businesses.id * 0.5488135039273248, LENGTH(businesses.id) + 2)) LIMIT 12 OFFSET 0

@spilliton
Copy link
Owner

Thanks for contributing!

I haven't checked out this specific case yet because it appears that all the tests were failing in master branch due to some minitest changes. I fixed those today.

As a first step, please merge master into your branch and ensure the tests pass. In addition, if you could add a test to ensure the behavior you were seeing works :)

@spilliton spilliton merged commit 00b80e6 into spilliton:master Jul 4, 2016
@spilliton
Copy link
Owner

Sorry took so long on this! Thanks for the fix 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants