{"action":"created","issue":{"url":"https://api.github.com/repos/collectiveidea/audited/issues/49","labels_url":"https://api.github.com/repos/collectiveidea/audited/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/collectiveidea/audited/issues/49/comments","events_url":"https://api.github.com/repos/collectiveidea/audited/issues/49/events","html_url":"https://github.com/collectiveidea/audited/issues/49","id":626434,"number":49,"title":"Audit.order not working as expected","user":{"login":"bbozo","id":633753,"avatar_url":"https://avatars.githubusercontent.com/u/633753?v=3","gravatar_id":"","url":"https://api.github.com/users/bbozo","html_url":"https://github.com/bbozo","followers_url":"https://api.github.com/users/bbozo/followers","following_url":"https://api.github.com/users/bbozo/following{/other_user}","gists_url":"https://api.github.com/users/bbozo/gists{/gist_id}","starred_url":"https://api.github.com/users/bbozo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbozo/subscriptions","organizations_url":"https://api.github.com/users/bbozo/orgs","repos_url":"https://api.github.com/users/bbozo/repos","events_url":"https://api.github.com/users/bbozo/events{/privacy}","received_events_url":"https://api.github.com/users/bbozo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2011-02-25T11:00:56Z","updated_at":"2015-12-04T10:40:04Z","closed_at":null,"body":"I had trouble writing a view for audits, the records wouldn't sort chronologically, so I tried:\r\n\r\n<pre>ruby-1.9.2-p0 > Audit.order(\"ID DESC\").all.each{|a| puts a.id  }\r\n10025\r\n10024\r\n10023\r\n10020\r\n10002\r\n10000\r\n10021\r\n10001\r\n10022</pre>\r\n\r\nThen I tried to_sql and got surprised:\r\n\r\n<pre>ruby-1.9.2-p0 > Audit.order(\"ID DESC\").to_sql\r\n => \"SELECT \\\"AUDITS\\\".* FROM \\\"AUDITS\\\" ORDER BY version, ID DESC\" </pre>\r\n\r\nIs there a workaround over this issue?\r\n\r\n\r\nBest regards,\r\n\r\nBorna"},"comment":{"url":"https://api.github.com/repos/collectiveidea/audited/issues/comments/161933793","html_url":"https://github.com/collectiveidea/audited/issues/49#issuecomment-161933793","issue_url":"https://api.github.com/repos/collectiveidea/audited/issues/49","id":161933793,"user":{"login":"ziomio","id":2357073,"avatar_url":"https://avatars.githubusercontent.com/u/2357073?v=3","gravatar_id":"","url":"https://api.github.com/users/ziomio","html_url":"https://github.com/ziomio","followers_url":"https://api.github.com/users/ziomio/followers","following_url":"https://api.github.com/users/ziomio/following{/other_user}","gists_url":"https://api.github.com/users/ziomio/gists{/gist_id}","starred_url":"https://api.github.com/users/ziomio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ziomio/subscriptions","organizations_url":"https://api.github.com/users/ziomio/orgs","repos_url":"https://api.github.com/users/ziomio/repos","events_url":"https://api.github.com/users/ziomio/events{/privacy}","received_events_url":"https://api.github.com/users/ziomio/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T10:40:04Z","updated_at":"2015-12-04T10:40:04Z","body":"Thanks njakobsen, you are a life saver!"}}