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

Wrong most_recent_created #3010

Closed
dexion opened this issue Apr 6, 2018 · 4 comments
Closed

Wrong most_recent_created #3010

dexion opened this issue Apr 6, 2018 · 4 comments

Comments

@dexion
Copy link
Contributor

dexion commented Apr 6, 2018

now it is
@most_recent_created[t.model.name] = t.model.last.try(:created_at)
rails 5 by default use order by "model_name".id. When using uuid as id it have wrong behaviour. I think this should use sorting order from model's settings

rails_admin do
    parent ParentModel
    list do
      sort_by :created_at
    end
end
  ...
@mshibuya
Copy link
Member

mshibuya commented May 3, 2018

This is expected, see #2514.

@mshibuya mshibuya closed this as completed May 3, 2018
@dexion
Copy link
Contributor Author

dexion commented May 3, 2018

So, I repeat: "it is wrong!". Now it show weather on Mars because rails 5 default sort by uuid. rails_admin should have setting for sort order (someone sort by id as in #2514, someone should sort by created_at or updated_at and have those indexes). If you wish, I can send test cases

@mshibuya
Copy link
Member

mshibuya commented May 3, 2018

Then letting users to choose which column to use to sort will be the option.
I don't want neither query on unindexed columns or forcing RailsAdmin users to have index, anyway.

@mshibuya mshibuya reopened this May 3, 2018
dexion pushed a commit to dexion/rails_admin that referenced this issue Dec 15, 2018
@runephilosof
Copy link

Rails 6 has implicit_order_column.
Please use that one for ordering.

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

3 participants