{"action":"created","issue":{"url":"https://api.github.com/repos/sferik/rails_admin/issues/1794","labels_url":"https://api.github.com/repos/sferik/rails_admin/issues/1794/labels{/name}","comments_url":"https://api.github.com/repos/sferik/rails_admin/issues/1794/comments","events_url":"https://api.github.com/repos/sferik/rails_admin/issues/1794/events","html_url":"https://github.com/sferik/rails_admin/issues/1794","id":20849295,"number":1794,"title":"Unquoted column name failes in ORDER BY in PostgreSQL","user":{"login":"sbwoodside","id":47834,"avatar_url":"https://avatars.githubusercontent.com/u/47834?v=3","gravatar_id":"","url":"https://api.github.com/users/sbwoodside","html_url":"https://github.com/sbwoodside","followers_url":"https://api.github.com/users/sbwoodside/followers","following_url":"https://api.github.com/users/sbwoodside/following{/other_user}","gists_url":"https://api.github.com/users/sbwoodside/gists{/gist_id}","starred_url":"https://api.github.com/users/sbwoodside/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbwoodside/subscriptions","organizations_url":"https://api.github.com/users/sbwoodside/orgs","repos_url":"https://api.github.com/users/sbwoodside/repos","events_url":"https://api.github.com/users/sbwoodside/events{/privacy}","received_events_url":"https://api.github.com/users/sbwoodside/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2013-10-11T03:58:33Z","updated_at":"2015-03-10T02:10:25Z","closed_at":"2015-03-10T02:10:25Z","body":"I have a users table with a field isPromoter, using PostgreSQL.\r\n\r\n      rails_admin do\r\n        list do\r\n          field :isPromoter do\r\n            label \"Is a Promoter?\"\r\n            column_width 120\r\n          end\r\n\r\n\r\nAs shown, this generates the following error:\r\n```\r\n  User Load (1.1ms)  SELECT \"users\".* FROM \"users\" ORDER BY users.isPromoter desc LIMIT 20 OFFSET 0\r\nPG::UndefinedColumn: ERROR:  column users.ispromoter does not exist\r\n```\r\n\r\nPostgres lowercases column names that are not quoted, the column is called isPromoter, not ispromoter.\r\n\r\nIf I change to:\r\n\r\n      rails_admin do\r\n        list do\r\n          field :isPromoter do\r\n            label \"Is a Promoter?\"\r\n            column_width 120\r\n            sortable '\"isPromoter\"'\r\n          end\r\n\r\nThen the query becomes:\r\n```\r\n  User Load (10.7ms)  SELECT \"users\".* FROM \"users\" WHERE \"users\".\"isPromoter\" = 't' AND \"users\".\"id\" IN (18)\r\n```\r\n\r\nWhich generates the correct result.\r\n\r\nI think that column names should probably be sorted by default"},"comment":{"url":"https://api.github.com/repos/sferik/rails_admin/issues/comments/77983613","html_url":"https://github.com/sferik/rails_admin/issues/1794#issuecomment-77983613","issue_url":"https://api.github.com/repos/sferik/rails_admin/issues/1794","id":77983613,"user":{"login":"mshibuya","id":486678,"avatar_url":"https://avatars.githubusercontent.com/u/486678?v=3","gravatar_id":"","url":"https://api.github.com/users/mshibuya","html_url":"https://github.com/mshibuya","followers_url":"https://api.github.com/users/mshibuya/followers","following_url":"https://api.github.com/users/mshibuya/following{/other_user}","gists_url":"https://api.github.com/users/mshibuya/gists{/gist_id}","starred_url":"https://api.github.com/users/mshibuya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mshibuya/subscriptions","organizations_url":"https://api.github.com/users/mshibuya/orgs","repos_url":"https://api.github.com/users/mshibuya/repos","events_url":"https://api.github.com/users/mshibuya/events{/privacy}","received_events_url":"https://api.github.com/users/mshibuya/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T02:10:25Z","updated_at":"2015-03-10T02:10:25Z","body":"Dup of #1631."}}