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

Issue when ordering in pagination #479

Closed
ilanstern opened this issue Dec 5, 2012 · 1 comment
Closed

Issue when ordering in pagination #479

ilanstern opened this issue Dec 5, 2012 · 1 comment

Comments

@ilanstern
Copy link

Tried to do the following query:
@events = Event.fields(:id, :name, :state, :start_date).paginate({:order => :created_at.desc, page: page, per_page: Event.per_page})

And received this error:
NoMethodError (undefined method `flatten' for #Squeel::Nodes::Order:0x007fdf9faa04e8).

Could only solve it doing:
@events = Event.fields(:id, :name, :state, :start_date).paginate({:order => 'created_at DESC', page: page, per_page: Event.per_page})

@cheald
Copy link
Member

cheald commented Jul 6, 2013

This looks like a conflict between MongoMapper's symbol extensions and Squeel's. See their extensions. In the case where two libraries are both trying to add the same behavior, it's going to have to be up to the user to resolve the conflicts, unfortunately.

@cheald cheald closed this as completed Jul 6, 2013
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

No branches or pull requests

2 participants