gregbell/active_admin — pull request #981 by ggilder (2012-02-06 06:16:20+00:00)
Title: fix SQL error with unquoted column names (#971)

Hi, I've put together a patch to fix the bug I observed. I've run the test suite and tested sorting in the tester Rails app and it does not appear to affect any other functionality. Please let me know if this is adequate or if there are other aspects you'd like tested to feel comfortable including the patch.

Here is a summary of the changes:

- 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

Thanks!
-Gabriel