GitHub PullRequestReviewCommentEvent at 2014-12-09 21:37:47
Repository: globalize
Actor: qnm
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/globalize/globalize/pulls/comments/21564607","id":21564607,"diff_hunk":"@@ -63,6 +71,25 @@ def join_translations(relation = self)\n           relation.with_translations_in_fallbacks\n         end\n       end\n+\n+      private\n+\n+      def parse_translated_order(opts)\n+        case opts\n+        when Hash\n+          ordering = opts.map do |column, direction|\n+            klass = translated_column?(column) ? translation_class : self\n+            klass.arel_table[column].send(direction)\n+          end\n+          order(ordering).order_clauses\n+        when Symbol\n+          translated_column_name(opts) if translated_attribute_names.include?(opts)\n+        end","path":"lib/globalize/active_record/query_methods.rb","position":32,"original_position":32,"commit_id":"3eafe205f2bc7b55c30cc47ba4cfd1a066dc5f93","original_commit_id":"3eafe205f2bc7b55c30cc47ba4cfd1a066dc5f93","user":{"login":"qnm","id":5343,"avatar_url":"https://avatars.githubusercontent.com/u/5343?v=3","gravatar_id":"","url":"https://api.github.com/users/qnm","html_url":"https://github.com/qnm","followers_url":"https://api.github.com/users/qnm/followers","following_url":"https://api.github.com/users/qnm/following{/other_user}","gists_url":"https://api.github.com/users/qnm/gists{/gist_id}","starred_url":"https://api.github.com/users/qnm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qnm/subscriptions","organizations_url":"https://api.github.com/users/qnm/orgs","repos_url":"https://api.github.com/users/qnm/repos","events_url":"https://api.github.com/users/qnm/events{/privacy}","received_events_url":"https://api.github.com/users/qnm/received_events","type":"User","site_admin":false},"body":"@simi should I add a default case to pass-through opts when neither condition is met? I don't see how that could happen, but it may be prudent.","created_at":"2014-12-09T21:37:47Z","updated_at":"2014-12-09T21:37:47Z","html_url":"https://github.com/globalize/globalize/pull/389#discussion_r21564607","pull_request_url":"https://api.github.com/repos/globalize/globalize/pulls/389","_links":{"self":{"href":"https://api.github.com/repos/globalize/globalize/pulls/comments/21564607"},"html":{"href":"https://github.com/globalize/globalize/pull/389#discussion_r21564607"},"pull_request":{"href":"https://api.github.com/repos/globalize/globalize/pulls/389"}}},"pull_request":{"url":"https://api.github.com/repos/globalize/globalize/pulls/389","id":25645384,"html_url":"https://github.com/globalize/globalize/pull/389","diff_url":"https://github.com/globalize/globalize/pull/389.diff","patch_url":"https://github.com/globalize/globalize/pull/389.patch","issue_url":"https://api.github.com/repos/globalize/globalize/issues/389","number":389,"state":"open","locked":false,"title":"Add `order` method to globalise.","user":{"login":"qnm","id":5343,"avatar_url":"https://avatars.githubusercontent.com/u/5343?v=3","gravatar_id":"","url":"https://api.github.com/users/qnm","html_url":"https://github.com/qnm","followers_url":"https://api.github.com/users/qnm/followers","following_url":"https://api.github.com/users/qnm/following{/other_user}","gists_url":"https://api.github.com/users/qnm/gists{/gist_id}","starred_url":"https://api.github.com/users/qnm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qnm/subscriptions","organizations_url":"https://api.github.com/users/qnm/orgs","repos_url":"https://api.github.com/users/qnm/repos","events_url":"https://api.github.com/users/qnm/events{/privacy}","received_events_url":"https://api.github.com/users/qnm/received_events","type":"User","site_admin":false},"body":"Populating `order` with a translated column name does not currently result in automatic mapping to the translation table.\r\n\r\nI've added an `order` method to `ActiveRecord::QueryMethods`, which will map a translated column to the translation table when called with either `order(:title)` or `order(title: :desc)` format.","created_at":"2014-12-08T04:44:31Z","updated_at":"2014-12-09T21:37:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e4211a1d7a75aae941f9b1b76f98da3d83874905","assignee":{"login":"simi","id":193936,"avatar_url":"https://avatars.githubusercontent.com/u/193936?v=3","gravatar_id":"","url":"https://api.github.com/users/simi","html_url":"https://github.com/simi","followers_url":"https://api.github.com/users/simi/followers","following_url":"https://api.github.com/users/simi/following{/other_user}","gists_url":"https://api.github.com/users/simi/gists{/gist_id}","starred_url":"https://api.github.com/users/simi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simi/subscriptions","organizations_url":"https://api.github.com/users/simi/orgs","repos_url":"https://api.github.com/users/simi/repos","events_url":"https://api.github.com/users/simi/events{/privacy}","received_events_url":"https://api.github.com/users/simi/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/globalize/globalize/pulls/389/commits","review_comments_url":"https://api.github.com/repos/globalize/globalize/pulls/389/comments","review_comment_url":"https://api.github.com/repos/globalize/globalize/pulls/comments/{number}","comments_url":"https://api.github.com/repos/globalize/globalize/issues/389/comments","statuses_url":"https://api.github.com/repos/globalize/globalize/statuses/3eafe205f2bc7b55c30cc47ba4cfd1a066dc5f93","head":{"label":"qnm:add-order-support","ref":"add-order-support","sha":"3eafe205f2bc7b55c30cc47ba4cfd1a066dc5f93","user":{"login":"qnm","id":5343,"avatar_url":"https://avatars.githubusercontent.com/u/5343?v=3","gravatar_id":"","url":"https://api.github.com/users/qnm","html_url":"https://github.com/qnm","followers_url":"https://api.github.com/users/qnm/followers","following_url":"https://api.github.com/users/qnm/following{/other_user}","gists_url":"https://api.github.com/users/qnm/gists{/gist_id}","starred_url":"https://api.github.com/users/qnm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qnm/subscriptions","organizations_url":"https://api.github.com/users/qnm/orgs","repos_url":"https://api.github.com/users/qnm/repos","events_url":"https://api.github.com/users/qnm/events{/privacy}","received_events_url":"https://api.github.com/users/qnm/received_events","type":"User","site_admin":false},"repo":{"id":27567974,"name":"globalize","full_name":"qnm/globalize","owner":{"login":"qnm","id":5343,"avatar_url":"https://avatars.githubusercontent.com/u/5343?v=3","gravatar_id":"","url":"https://api.github.com/users/qnm","html_url":"https://github.com/qnm","followers_url":"https://api.github.com/users/qnm/followers","following_url":"https://api.github.com/users/qnm/following{/other_user}","gists_url":"https://api.github.com/users/qnm/gists{/gist_id}","starred_url":"https://api.github.com/users/qnm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qnm/subscriptions","organizations_url":"https://api.github.com/users/qnm/orgs","repos_url":"https://api.github.com/users/qnm/repos","events_url":"https://api.github.com/users/qnm/events{/privacy}","received_events_url":"https://api.github.com/users/qnm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/qnm/globalize","description":"Rails I18n de-facto standard library for ActiveRecord model/data translation.","fork":true,"url":"https://api.github.com/repos/qnm/globalize","forks_url":"https://api.github.com/repos/qnm/globalize/forks","keys_url":"https://api.github.com/repos/qnm/globalize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qnm/globalize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qnm/globalize/teams","hooks_url":"https://api.github.com/repos/qnm/globalize/hooks","issue_events_url":"https://api.github.com/repos/qnm/globalize/issues/events{/number}","events_url":"https://api.github.com/repos/qnm/globalize/events","assignees_url":"https://api.github.com/repos/qnm/globalize/assignees{/user}","branches_url":"https://api.github.com/repos/qnm/globalize/branches{/branch}","tags_url":"https://api.github.com/repos/qnm/globalize/tags","blobs_url":"https://api.github.com/repos/qnm/globalize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qnm/globalize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qnm/globalize/git/refs{/sha}","trees_url":"https://api.github.com/repos/qnm/globalize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qnm/globalize/statuses/{sha}","languages_url":"https://api.github.com/repos/qnm/globalize/languages","stargazers_url":"https://api.github.com/repos/qnm/globalize/stargazers","contributors_url":"https://api.github.com/repos/qnm/globalize/contributors","subscribers_url":"https://api.github.com/repos/qnm/globalize/subscribers","subscription_url":"https://api.github.com/repos/qnm/globalize/subscription","commits_url":"https://api.github.com/repos/qnm/globalize/commits{/sha}","git_commits_url":"https://api.github.com/repos/qnm/globalize/git/commits{/sha}","comments_url":"https://api.github.com/repos/qnm/globalize/comments{/number}","issue_comment_url":"https://api.github.com/repos/qnm/globalize/issues/comments/{number}","contents_url":"https://api.github.com/repos/qnm/globalize/contents/{+path}","compare_url":"https://api.github.com/repos/qnm/globalize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qnm/globalize/merges","archive_url":"https://api.github.com/repos/qnm/globalize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qnm/globalize/downloads","issues_url":"https://api.github.com/repos/qnm/globalize/issues{/number}","pulls_url":"https://api.github.com/repos/qnm/globalize/pulls{/number}","milestones_url":"https://api.github.com/repos/qnm/globalize/milestones{/number}","notifications_url":"https://api.github.com/repos/qnm/globalize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qnm/globalize/labels{/name}","releases_url":"https://api.github.com/repos/qnm/globalize/releases{/id}","created_at":"2014-12-05T01:09:42Z","updated_at":"2014-12-05T01:09:42Z","pushed_at":"2014-12-09T09:06:32Z","git_url":"git://github.com/qnm/globalize.git","ssh_url":"git@github.com:qnm/globalize.git","clone_url":"https://github.com/qnm/globalize.git","svn_url":"https://github.com/qnm/globalize","homepage":"","size":1482,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"globalize:master","ref":"master","sha":"324791dc599dd80b4e8bfcb618e1510b0865dbbc","user":{"login":"globalize","id":5650452,"avatar_url":"https://avatars.githubusercontent.com/u/5650452?v=3","gravatar_id":"","url":"https://api.github.com/users/globalize","html_url":"https://github.com/globalize","followers_url":"https://api.github.com/users/globalize/followers","following_url":"https://api.github.com/users/globalize/following{/other_user}","gists_url":"https://api.github.com/users/globalize/gists{/gist_id}","starred_url":"https://api.github.com/users/globalize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globalize/subscriptions","organizations_url":"https://api.github.com/users/globalize/orgs","repos_url":"https://api.github.com/users/globalize/repos","events_url":"https://api.github.com/users/globalize/events{/privacy}","received_events_url":"https://api.github.com/users/globalize/received_events","type":"Organization","site_admin":false},"repo":{"id":807517,"name":"globalize","full_name":"globalize/globalize","owner":{"login":"globalize","id":5650452,"avatar_url":"https://avatars.githubusercontent.com/u/5650452?v=3","gravatar_id":"","url":"https://api.github.com/users/globalize","html_url":"https://github.com/globalize","followers_url":"https://api.github.com/users/globalize/followers","following_url":"https://api.github.com/users/globalize/following{/other_user}","gists_url":"https://api.github.com/users/globalize/gists{/gist_id}","starred_url":"https://api.github.com/users/globalize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globalize/subscriptions","organizations_url":"https://api.github.com/users/globalize/orgs","repos_url":"https://api.github.com/users/globalize/repos","events_url":"https://api.github.com/users/globalize/events{/privacy}","received_events_url":"https://api.github.com/users/globalize/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/globalize/globalize","description":"Rails I18n de-facto standard library for ActiveRecord model/data translation.","fork":false,"url":"https://api.github.com/repos/globalize/globalize","forks_url":"https://api.github.com/repos/globalize/globalize/forks","keys_url":"https://api.github.com/repos/globalize/globalize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/globalize/globalize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/globalize/globalize/teams","hooks_url":"https://api.github.com/repos/globalize/globalize/hooks","issue_events_url":"https://api.github.com/repos/globalize/globalize/issues/events{/number}","events_url":"https://api.github.com/repos/globalize/globalize/events","assignees_url":"https://api.github.com/repos/globalize/globalize/assignees{/user}","branches_url":"https://api.github.com/repos/globalize/globalize/branches{/branch}","tags_url":"https://api.github.com/repos/globalize/globalize/tags","blobs_url":"https://api.github.com/repos/globalize/globalize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/globalize/globalize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/globalize/globalize/git/refs{/sha}","trees_url":"https://api.github.com/repos/globalize/globalize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/globalize/globalize/statuses/{sha}","languages_url":"https://api.github.com/repos/globalize/globalize/languages","stargazers_url":"https://api.github.com/repos/globalize/globalize/stargazers","contributors_url":"https://api.github.com/repos/globalize/globalize/contributors","subscribers_url":"https://api.github.com/repos/globalize/globalize/subscribers","subscription_url":"https://api.github.com/repos/globalize/globalize/subscription","commits_url":"https://api.github.com/repos/globalize/globalize/commits{/sha}","git_commits_url":"https://api.github.com/repos/globalize/globalize/git/commits{/sha}","comments_url":"https://api.github.com/repos/globalize/globalize/comments{/number}","issue_comment_url":"https://api.github.com/repos/globalize/globalize/issues/comments/{number}","contents_url":"https://api.github.com/repos/globalize/globalize/contents/{+path}","compare_url":"https://api.github.com/repos/globalize/globalize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/globalize/globalize/merges","archive_url":"https://api.github.com/repos/globalize/globalize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/globalize/globalize/downloads","issues_url":"https://api.github.com/repos/globalize/globalize/issues{/number}","pulls_url":"https://api.github.com/repos/globalize/globalize/pulls{/number}","milestones_url":"https://api.github.com/repos/globalize/globalize/milestones{/number}","notifications_url":"https://api.github.com/repos/globalize/globalize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/globalize/globalize/labels{/name}","releases_url":"https://api.github.com/repos/globalize/globalize/releases{/id}","created_at":"2010-07-30T14:30:27Z","updated_at":"2014-12-09T17:51:58Z","pushed_at":"2014-11-25T00:01:21Z","git_url":"git://github.com/globalize/globalize.git","ssh_url":"git@github.com:globalize/globalize.git","clone_url":"https://github.com/globalize/globalize.git","svn_url":"https://github.com/globalize/globalize","homepage":"","size":4033,"stargazers_count":899,"watchers_count":899,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":223,"mirror_url":null,"open_issues_count":48,"forks":223,"open_issues":48,"watchers":899,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/globalize/globalize/pulls/389"},"html":{"href":"https://github.com/globalize/globalize/pull/389"},"issue":{"href":"https://api.github.com/repos/globalize/globalize/issues/389"},"comments":{"href":"https://api.github.com/repos/globalize/globalize/issues/389/comments"},"review_comments":{"href":"https://api.github.com/repos/globalize/globalize/pulls/389/comments"},"review_comment":{"href":"https://api.github.com/repos/globalize/globalize/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/globalize/globalize/pulls/389/commits"},"statuses":{"href":"https://api.github.com/repos/globalize/globalize/statuses/3eafe205f2bc7b55c30cc47ba4cfd1a066dc5f93"}}}}