You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I use ActiveAdmin to manage a model with a field named "group", and I include that field as a column in the index, then clicking on the column header to sort by group produces the following error:
SQLite3::SQLException: near "group": syntax error: SELECT "mymodel".* FROM "mymodel" ORDER BY "mymodel".group desc LIMIT 30 OFFSET 0
It looks to me like the column name should be quoted as well - I traced this down to lib/active_admin/resource_controller/collection.rb, line 53 as of commit 813c86b. It works correctly for me if I change that line to:
- Add ActiveAdmin::Resource#resource_quoted_column_name to provide access to ActiveRecord's built-in column name quoting
- Modify ActiveAdmin::ResourceController::Collection::BaseCollection::Sorting#sort_order to quote the column name used in sorting
- Modify spec for ActiveAdmin::ResourceController::Collection to reflect expectation of having column name quoted
If I use ActiveAdmin to manage a model with a field named "group", and I include that field as a column in the index, then clicking on the column header to sort by group produces the following error:
It looks to me like the column name should be quoted as well - I traced this down to
lib/active_admin/resource_controller/collection.rb
, line 53 as of commit 813c86b. It works correctly for me if I change that line to:But I'm getting a hard Ruby crash trying to run the test suite, so I'm not able to see what other things that might affect.
Thoughts?
-Gabriel
The text was updated successfully, but these errors were encountered: