{"action":"created","comment":{"url":"https://api.github.com/repos/data-axle/superstore/pulls/comments/28271064","id":28271064,"diff_hunk":"@@ -0,0 +1,210 @@\n+gem 'pg'\n+require 'pg'\n+\n+module Superstore\n+  module Adapters\n+    class JsonbAdapter < AbstractAdapter\n+      class QueryBuilder\n+        def initialize(adapter, scope)\n+          @adapter  = adapter\n+          @scope    = scope\n+        end\n+\n+        def to_query\n+          [\n+            \"SELECT #{select_string} FROM #{@scope.klass.table_name}\",\n+            where_string,\n+            order_string,\n+            limit_string\n+          ].delete_if(&:blank?) * ' '","path":"lib/superstore/adapters/jsonb_adapter.rb","position":19,"original_position":19,"commit_id":"41e08000c450d4a0bafebf537f189d481914b578","original_commit_id":"41e08000c450d4a0bafebf537f189d481914b578","user":{"login":"matthuhiggins","id":8185,"avatar_url":"https://avatars.githubusercontent.com/u/8185?v=3","gravatar_id":"","url":"https://api.github.com/users/matthuhiggins","html_url":"https://github.com/matthuhiggins","followers_url":"https://api.github.com/users/matthuhiggins/followers","following_url":"https://api.github.com/users/matthuhiggins/following{/other_user}","gists_url":"https://api.github.com/users/matthuhiggins/gists{/gist_id}","starred_url":"https://api.github.com/users/matthuhiggins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthuhiggins/subscriptions","organizations_url":"https://api.github.com/users/matthuhiggins/orgs","repos_url":"https://api.github.com/users/matthuhiggins/repos","events_url":"https://api.github.com/users/matthuhiggins/events{/privacy}","received_events_url":"https://api.github.com/users/matthuhiggins/received_events","type":"User","site_admin":false},"body":"Ah. Only because I didn't want a bunch of white space in the string. This came from hstore_adapter, which came from code that was in Rails 3.","created_at":"2015-04-13T19:34:04Z","updated_at":"2015-04-13T19:34:04Z","html_url":"https://github.com/data-axle/superstore/pull/9#discussion_r28271064","pull_request_url":"https://api.github.com/repos/data-axle/superstore/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/data-axle/superstore/pulls/comments/28271064"},"html":{"href":"https://github.com/data-axle/superstore/pull/9#discussion_r28271064"},"pull_request":{"href":"https://api.github.com/repos/data-axle/superstore/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/data-axle/superstore/pulls/9","id":33115124,"html_url":"https://github.com/data-axle/superstore/pull/9","diff_url":"https://github.com/data-axle/superstore/pull/9.diff","patch_url":"https://github.com/data-axle/superstore/pull/9.patch","issue_url":"https://api.github.com/repos/data-axle/superstore/issues/9","number":9,"state":"open","locked":false,"title":"A functioning bjson adapter (Tests are WIP)","user":{"login":"matthuhiggins","id":8185,"avatar_url":"https://avatars.githubusercontent.com/u/8185?v=3","gravatar_id":"","url":"https://api.github.com/users/matthuhiggins","html_url":"https://github.com/matthuhiggins","followers_url":"https://api.github.com/users/matthuhiggins/followers","following_url":"https://api.github.com/users/matthuhiggins/following{/other_user}","gists_url":"https://api.github.com/users/matthuhiggins/gists{/gist_id}","starred_url":"https://api.github.com/users/matthuhiggins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthuhiggins/subscriptions","organizations_url":"https://api.github.com/users/matthuhiggins/orgs","repos_url":"https://api.github.com/users/matthuhiggins/repos","events_url":"https://api.github.com/users/matthuhiggins/events{/privacy}","received_events_url":"https://api.github.com/users/matthuhiggins/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-12T05:14:59Z","updated_at":"2015-04-13T19:34:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e9422918fe4106be65dc8701a3f70cefee45a84b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/data-axle/superstore/pulls/9/commits","review_comments_url":"https://api.github.com/repos/data-axle/superstore/pulls/9/comments","review_comment_url":"https://api.github.com/repos/data-axle/superstore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/data-axle/superstore/issues/9/comments","statuses_url":"https://api.github.com/repos/data-axle/superstore/statuses/41e08000c450d4a0bafebf537f189d481914b578","head":{"label":"data-axle:bjson-adapter","ref":"bjson-adapter","sha":"41e08000c450d4a0bafebf537f189d481914b578","user":{"login":"data-axle","id":1663168,"avatar_url":"https://avatars.githubusercontent.com/u/1663168?v=3","gravatar_id":"","url":"https://api.github.com/users/data-axle","html_url":"https://github.com/data-axle","followers_url":"https://api.github.com/users/data-axle/followers","following_url":"https://api.github.com/users/data-axle/following{/other_user}","gists_url":"https://api.github.com/users/data-axle/gists{/gist_id}","starred_url":"https://api.github.com/users/data-axle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/data-axle/subscriptions","organizations_url":"https://api.github.com/users/data-axle/orgs","repos_url":"https://api.github.com/users/data-axle/repos","events_url":"https://api.github.com/users/data-axle/events{/privacy}","received_events_url":"https://api.github.com/users/data-axle/received_events","type":"Organization","site_admin":false},"repo":{"id":18688348,"name":"superstore","full_name":"data-axle/superstore","owner":{"login":"data-axle","id":1663168,"avatar_url":"https://avatars.githubusercontent.com/u/1663168?v=3","gravatar_id":"","url":"https://api.github.com/users/data-axle","html_url":"https://github.com/data-axle","followers_url":"https://api.github.com/users/data-axle/followers","following_url":"https://api.github.com/users/data-axle/following{/other_user}","gists_url":"https://api.github.com/users/data-axle/gists{/gist_id}","starred_url":"https://api.github.com/users/data-axle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/data-axle/subscriptions","organizations_url":"https://api.github.com/users/data-axle/orgs","repos_url":"https://api.github.com/users/data-axle/repos","events_url":"https://api.github.com/users/data-axle/events{/privacy}","received_events_url":"https://api.github.com/users/data-axle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/data-axle/superstore","description":"","fork":false,"url":"https://api.github.com/repos/data-axle/superstore","forks_url":"https://api.github.com/repos/data-axle/superstore/forks","keys_url":"https://api.github.com/repos/data-axle/superstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/data-axle/superstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/data-axle/superstore/teams","hooks_url":"https://api.github.com/repos/data-axle/superstore/hooks","issue_events_url":"https://api.github.com/repos/data-axle/superstore/issues/events{/number}","events_url":"https://api.github.com/repos/data-axle/superstore/events","assignees_url":"https://api.github.com/repos/data-axle/superstore/assignees{/user}","branches_url":"https://api.github.com/repos/data-axle/superstore/branches{/branch}","tags_url":"https://api.github.com/repos/data-axle/superstore/tags","blobs_url":"https://api.github.com/repos/data-axle/superstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/data-axle/superstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/data-axle/superstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/data-axle/superstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/data-axle/superstore/statuses/{sha}","languages_url":"https://api.github.com/repos/data-axle/superstore/languages","stargazers_url":"https://api.github.com/repos/data-axle/superstore/stargazers","contributors_url":"https://api.github.com/repos/data-axle/superstore/contributors","subscribers_url":"https://api.github.com/repos/data-axle/superstore/subscribers","subscription_url":"https://api.github.com/repos/data-axle/superstore/subscription","commits_url":"https://api.github.com/repos/data-axle/superstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/data-axle/superstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/data-axle/superstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/data-axle/superstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/data-axle/superstore/contents/{+path}","compare_url":"https://api.github.com/repos/data-axle/superstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/data-axle/superstore/merges","archive_url":"https://api.github.com/repos/data-axle/superstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/data-axle/superstore/downloads","issues_url":"https://api.github.com/repos/data-axle/superstore/issues{/number}","pulls_url":"https://api.github.com/repos/data-axle/superstore/pulls{/number}","milestones_url":"https://api.github.com/repos/data-axle/superstore/milestones{/number}","notifications_url":"https://api.github.com/repos/data-axle/superstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/data-axle/superstore/labels{/name}","releases_url":"https://api.github.com/repos/data-axle/superstore/releases{/id}","created_at":"2014-04-11T20:51:10Z","updated_at":"2015-04-10T01:39:30Z","pushed_at":"2015-04-13T04:51:59Z","git_url":"git://github.com/data-axle/superstore.git","ssh_url":"git@github.com:data-axle/superstore.git","clone_url":"https://github.com/data-axle/superstore.git","svn_url":"https://github.com/data-axle/superstore","homepage":null,"size":5084,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"data-axle:master","ref":"master","sha":"fb33a714d3a6ef3ffa093457e4cbae27e3ccc176","user":{"login":"data-axle","id":1663168,"avatar_url":"https://avatars.githubusercontent.com/u/1663168?v=3","gravatar_id":"","url":"https://api.github.com/users/data-axle","html_url":"https://github.com/data-axle","followers_url":"https://api.github.com/users/data-axle/followers","following_url":"https://api.github.com/users/data-axle/following{/other_user}","gists_url":"https://api.github.com/users/data-axle/gists{/gist_id}","starred_url":"https://api.github.com/users/data-axle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/data-axle/subscriptions","organizations_url":"https://api.github.com/users/data-axle/orgs","repos_url":"https://api.github.com/users/data-axle/repos","events_url":"https://api.github.com/users/data-axle/events{/privacy}","received_events_url":"https://api.github.com/users/data-axle/received_events","type":"Organization","site_admin":false},"repo":{"id":18688348,"name":"superstore","full_name":"data-axle/superstore","owner":{"login":"data-axle","id":1663168,"avatar_url":"https://avatars.githubusercontent.com/u/1663168?v=3","gravatar_id":"","url":"https://api.github.com/users/data-axle","html_url":"https://github.com/data-axle","followers_url":"https://api.github.com/users/data-axle/followers","following_url":"https://api.github.com/users/data-axle/following{/other_user}","gists_url":"https://api.github.com/users/data-axle/gists{/gist_id}","starred_url":"https://api.github.com/users/data-axle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/data-axle/subscriptions","organizations_url":"https://api.github.com/users/data-axle/orgs","repos_url":"https://api.github.com/users/data-axle/repos","events_url":"https://api.github.com/users/data-axle/events{/privacy}","received_events_url":"https://api.github.com/users/data-axle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/data-axle/superstore","description":"","fork":false,"url":"https://api.github.com/repos/data-axle/superstore","forks_url":"https://api.github.com/repos/data-axle/superstore/forks","keys_url":"https://api.github.com/repos/data-axle/superstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/data-axle/superstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/data-axle/superstore/teams","hooks_url":"https://api.github.com/repos/data-axle/superstore/hooks","issue_events_url":"https://api.github.com/repos/data-axle/superstore/issues/events{/number}","events_url":"https://api.github.com/repos/data-axle/superstore/events","assignees_url":"https://api.github.com/repos/data-axle/superstore/assignees{/user}","branches_url":"https://api.github.com/repos/data-axle/superstore/branches{/branch}","tags_url":"https://api.github.com/repos/data-axle/superstore/tags","blobs_url":"https://api.github.com/repos/data-axle/superstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/data-axle/superstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/data-axle/superstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/data-axle/superstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/data-axle/superstore/statuses/{sha}","languages_url":"https://api.github.com/repos/data-axle/superstore/languages","stargazers_url":"https://api.github.com/repos/data-axle/superstore/stargazers","contributors_url":"https://api.github.com/repos/data-axle/superstore/contributors","subscribers_url":"https://api.github.com/repos/data-axle/superstore/subscribers","subscription_url":"https://api.github.com/repos/data-axle/superstore/subscription","commits_url":"https://api.github.com/repos/data-axle/superstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/data-axle/superstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/data-axle/superstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/data-axle/superstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/data-axle/superstore/contents/{+path}","compare_url":"https://api.github.com/repos/data-axle/superstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/data-axle/superstore/merges","archive_url":"https://api.github.com/repos/data-axle/superstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/data-axle/superstore/downloads","issues_url":"https://api.github.com/repos/data-axle/superstore/issues{/number}","pulls_url":"https://api.github.com/repos/data-axle/superstore/pulls{/number}","milestones_url":"https://api.github.com/repos/data-axle/superstore/milestones{/number}","notifications_url":"https://api.github.com/repos/data-axle/superstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/data-axle/superstore/labels{/name}","releases_url":"https://api.github.com/repos/data-axle/superstore/releases{/id}","created_at":"2014-04-11T20:51:10Z","updated_at":"2015-04-10T01:39:30Z","pushed_at":"2015-04-13T04:51:59Z","git_url":"git://github.com/data-axle/superstore.git","ssh_url":"git@github.com:data-axle/superstore.git","clone_url":"https://github.com/data-axle/superstore.git","svn_url":"https://github.com/data-axle/superstore","homepage":null,"size":5084,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/data-axle/superstore/pulls/9"},"html":{"href":"https://github.com/data-axle/superstore/pull/9"},"issue":{"href":"https://api.github.com/repos/data-axle/superstore/issues/9"},"comments":{"href":"https://api.github.com/repos/data-axle/superstore/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/data-axle/superstore/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/data-axle/superstore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/data-axle/superstore/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/data-axle/superstore/statuses/41e08000c450d4a0bafebf537f189d481914b578"}}}}