{"action":"created","comment":{"url":"https://api.github.com/repos/avantcredit/saseo/pulls/comments/44357330","id":44357330,"diff_hunk":"@@ -9,48 +7,36 @@ module Saseo\n   module Publishing\n     class Publisher\n \n-      attr_reader :channels\n+      attr_accessor :batch_size\n       attr_writer :logger\n \n-      def initialize(channels: nil)\n-        self.channels = channels\n+      def initialize(batch_size: nil)\n+        batch_size      ||= Saseo.config.publisher_batch_size\n+        self.batch_size = batch_size\n       end\n \n       def logger\n         @logger ||= Logger.new(STDOUT)\n       end\n \n-      def channels=(val)\n-        if val == :all\n-          tables = db_connection.tables\n-\n-          @channels = tables.reduce([]) do |channels, table|\n-            %w[insert update delete].each do |operation|\n-              channels << \"SASEO_#{table}_#{operation}_AUDIT\".upcase\n-            end\n-            channels\n+      def publish_batch\n+        Saseo::Models::Source::Version.transaction do\n+          Saseo::Models::Source::Version.find_each(batch_size: batch_size) do |record|","path":"lib/saseo/publishing/publisher.rb","position":null,"original_position":36,"commit_id":"ad8350f329797c7e1e0246e936ba93ed36b2faaf","original_commit_id":"9f4823899c5b7239b47dece1c9fb21b04fe8d98a","user":{"login":"MissingHandle","id":55783,"avatar_url":"https://avatars.githubusercontent.com/u/55783?v=3","gravatar_id":"","url":"https://api.github.com/users/MissingHandle","html_url":"https://github.com/MissingHandle","followers_url":"https://api.github.com/users/MissingHandle/followers","following_url":"https://api.github.com/users/MissingHandle/following{/other_user}","gists_url":"https://api.github.com/users/MissingHandle/gists{/gist_id}","starred_url":"https://api.github.com/users/MissingHandle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MissingHandle/subscriptions","organizations_url":"https://api.github.com/users/MissingHandle/orgs","repos_url":"https://api.github.com/users/MissingHandle/repos","events_url":"https://api.github.com/users/MissingHandle/events{/privacy}","received_events_url":"https://api.github.com/users/MissingHandle/received_events","type":"User","site_admin":false},"body":"or perhaps that was your intention?","created_at":"2015-11-10T00:57:06Z","updated_at":"2015-11-10T00:57:06Z","html_url":"https://github.com/avantcredit/saseo/pull/12#discussion_r44357330","pull_request_url":"https://api.github.com/repos/avantcredit/saseo/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/avantcredit/saseo/pulls/comments/44357330"},"html":{"href":"https://github.com/avantcredit/saseo/pull/12#discussion_r44357330"},"pull_request":{"href":"https://api.github.com/repos/avantcredit/saseo/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/avantcredit/saseo/pulls/12","id":50198594,"html_url":"https://github.com/avantcredit/saseo/pull/12","diff_url":"https://github.com/avantcredit/saseo/pull/12.diff","patch_url":"https://github.com/avantcredit/saseo/pull/12.patch","issue_url":"https://api.github.com/repos/avantcredit/saseo/issues/12","number":12,"state":"open","locked":false,"title":"polling publisher","user":{"login":"nkeyes","id":1145493,"avatar_url":"https://avatars.githubusercontent.com/u/1145493?v=3","gravatar_id":"","url":"https://api.github.com/users/nkeyes","html_url":"https://github.com/nkeyes","followers_url":"https://api.github.com/users/nkeyes/followers","following_url":"https://api.github.com/users/nkeyes/following{/other_user}","gists_url":"https://api.github.com/users/nkeyes/gists{/gist_id}","starred_url":"https://api.github.com/users/nkeyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkeyes/subscriptions","organizations_url":"https://api.github.com/users/nkeyes/orgs","repos_url":"https://api.github.com/users/nkeyes/repos","events_url":"https://api.github.com/users/nkeyes/events{/privacy}","received_events_url":"https://api.github.com/users/nkeyes/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-10T00:27:00Z","updated_at":"2015-11-10T00:57:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f85a0df9f441c548a724f9f29511a3d66fbcb278","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/avantcredit/saseo/pulls/12/commits","review_comments_url":"https://api.github.com/repos/avantcredit/saseo/pulls/12/comments","review_comment_url":"https://api.github.com/repos/avantcredit/saseo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/avantcredit/saseo/issues/12/comments","statuses_url":"https://api.github.com/repos/avantcredit/saseo/statuses/ad8350f329797c7e1e0246e936ba93ed36b2faaf","head":{"label":"avantcredit:polling-publisher","ref":"polling-publisher","sha":"ad8350f329797c7e1e0246e936ba93ed36b2faaf","user":{"login":"avantcredit","id":2895811,"avatar_url":"https://avatars.githubusercontent.com/u/2895811?v=3","gravatar_id":"","url":"https://api.github.com/users/avantcredit","html_url":"https://github.com/avantcredit","followers_url":"https://api.github.com/users/avantcredit/followers","following_url":"https://api.github.com/users/avantcredit/following{/other_user}","gists_url":"https://api.github.com/users/avantcredit/gists{/gist_id}","starred_url":"https://api.github.com/users/avantcredit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avantcredit/subscriptions","organizations_url":"https://api.github.com/users/avantcredit/orgs","repos_url":"https://api.github.com/users/avantcredit/repos","events_url":"https://api.github.com/users/avantcredit/events{/privacy}","received_events_url":"https://api.github.com/users/avantcredit/received_events","type":"Organization","site_admin":false},"repo":{"id":44700671,"name":"saseo","full_name":"avantcredit/saseo","owner":{"login":"avantcredit","id":2895811,"avatar_url":"https://avatars.githubusercontent.com/u/2895811?v=3","gravatar_id":"","url":"https://api.github.com/users/avantcredit","html_url":"https://github.com/avantcredit","followers_url":"https://api.github.com/users/avantcredit/followers","following_url":"https://api.github.com/users/avantcredit/following{/other_user}","gists_url":"https://api.github.com/users/avantcredit/gists{/gist_id}","starred_url":"https://api.github.com/users/avantcredit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avantcredit/subscriptions","organizations_url":"https://api.github.com/users/avantcredit/orgs","repos_url":"https://api.github.com/users/avantcredit/repos","events_url":"https://api.github.com/users/avantcredit/events{/privacy}","received_events_url":"https://api.github.com/users/avantcredit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/avantcredit/saseo","description":"RabbitMQ based PaperTrail replacement","fork":false,"url":"https://api.github.com/repos/avantcredit/saseo","forks_url":"https://api.github.com/repos/avantcredit/saseo/forks","keys_url":"https://api.github.com/repos/avantcredit/saseo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avantcredit/saseo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avantcredit/saseo/teams","hooks_url":"https://api.github.com/repos/avantcredit/saseo/hooks","issue_events_url":"https://api.github.com/repos/avantcredit/saseo/issues/events{/number}","events_url":"https://api.github.com/repos/avantcredit/saseo/events","assignees_url":"https://api.github.com/repos/avantcredit/saseo/assignees{/user}","branches_url":"https://api.github.com/repos/avantcredit/saseo/branches{/branch}","tags_url":"https://api.github.com/repos/avantcredit/saseo/tags","blobs_url":"https://api.github.com/repos/avantcredit/saseo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avantcredit/saseo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avantcredit/saseo/git/refs{/sha}","trees_url":"https://api.github.com/repos/avantcredit/saseo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avantcredit/saseo/statuses/{sha}","languages_url":"https://api.github.com/repos/avantcredit/saseo/languages","stargazers_url":"https://api.github.com/repos/avantcredit/saseo/stargazers","contributors_url":"https://api.github.com/repos/avantcredit/saseo/contributors","subscribers_url":"https://api.github.com/repos/avantcredit/saseo/subscribers","subscription_url":"https://api.github.com/repos/avantcredit/saseo/subscription","commits_url":"https://api.github.com/repos/avantcredit/saseo/commits{/sha}","git_commits_url":"https://api.github.com/repos/avantcredit/saseo/git/commits{/sha}","comments_url":"https://api.github.com/repos/avantcredit/saseo/comments{/number}","issue_comment_url":"https://api.github.com/repos/avantcredit/saseo/issues/comments{/number}","contents_url":"https://api.github.com/repos/avantcredit/saseo/contents/{+path}","compare_url":"https://api.github.com/repos/avantcredit/saseo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avantcredit/saseo/merges","archive_url":"https://api.github.com/repos/avantcredit/saseo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avantcredit/saseo/downloads","issues_url":"https://api.github.com/repos/avantcredit/saseo/issues{/number}","pulls_url":"https://api.github.com/repos/avantcredit/saseo/pulls{/number}","milestones_url":"https://api.github.com/repos/avantcredit/saseo/milestones{/number}","notifications_url":"https://api.github.com/repos/avantcredit/saseo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avantcredit/saseo/labels{/name}","releases_url":"https://api.github.com/repos/avantcredit/saseo/releases{/id}","created_at":"2015-10-21T19:56:39Z","updated_at":"2015-10-22T19:32:44Z","pushed_at":"2015-11-10T00:56:46Z","git_url":"git://github.com/avantcredit/saseo.git","ssh_url":"git@github.com:avantcredit/saseo.git","clone_url":"https://github.com/avantcredit/saseo.git","svn_url":"https://github.com/avantcredit/saseo","homepage":null,"size":443,"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":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"avantcredit:master","ref":"master","sha":"4d5076c4862c5f6832de6bd7acf2ddc9e70f10e5","user":{"login":"avantcredit","id":2895811,"avatar_url":"https://avatars.githubusercontent.com/u/2895811?v=3","gravatar_id":"","url":"https://api.github.com/users/avantcredit","html_url":"https://github.com/avantcredit","followers_url":"https://api.github.com/users/avantcredit/followers","following_url":"https://api.github.com/users/avantcredit/following{/other_user}","gists_url":"https://api.github.com/users/avantcredit/gists{/gist_id}","starred_url":"https://api.github.com/users/avantcredit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avantcredit/subscriptions","organizations_url":"https://api.github.com/users/avantcredit/orgs","repos_url":"https://api.github.com/users/avantcredit/repos","events_url":"https://api.github.com/users/avantcredit/events{/privacy}","received_events_url":"https://api.github.com/users/avantcredit/received_events","type":"Organization","site_admin":false},"repo":{"id":44700671,"name":"saseo","full_name":"avantcredit/saseo","owner":{"login":"avantcredit","id":2895811,"avatar_url":"https://avatars.githubusercontent.com/u/2895811?v=3","gravatar_id":"","url":"https://api.github.com/users/avantcredit","html_url":"https://github.com/avantcredit","followers_url":"https://api.github.com/users/avantcredit/followers","following_url":"https://api.github.com/users/avantcredit/following{/other_user}","gists_url":"https://api.github.com/users/avantcredit/gists{/gist_id}","starred_url":"https://api.github.com/users/avantcredit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avantcredit/subscriptions","organizations_url":"https://api.github.com/users/avantcredit/orgs","repos_url":"https://api.github.com/users/avantcredit/repos","events_url":"https://api.github.com/users/avantcredit/events{/privacy}","received_events_url":"https://api.github.com/users/avantcredit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/avantcredit/saseo","description":"RabbitMQ based PaperTrail replacement","fork":false,"url":"https://api.github.com/repos/avantcredit/saseo","forks_url":"https://api.github.com/repos/avantcredit/saseo/forks","keys_url":"https://api.github.com/repos/avantcredit/saseo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avantcredit/saseo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avantcredit/saseo/teams","hooks_url":"https://api.github.com/repos/avantcredit/saseo/hooks","issue_events_url":"https://api.github.com/repos/avantcredit/saseo/issues/events{/number}","events_url":"https://api.github.com/repos/avantcredit/saseo/events","assignees_url":"https://api.github.com/repos/avantcredit/saseo/assignees{/user}","branches_url":"https://api.github.com/repos/avantcredit/saseo/branches{/branch}","tags_url":"https://api.github.com/repos/avantcredit/saseo/tags","blobs_url":"https://api.github.com/repos/avantcredit/saseo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avantcredit/saseo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avantcredit/saseo/git/refs{/sha}","trees_url":"https://api.github.com/repos/avantcredit/saseo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avantcredit/saseo/statuses/{sha}","languages_url":"https://api.github.com/repos/avantcredit/saseo/languages","stargazers_url":"https://api.github.com/repos/avantcredit/saseo/stargazers","contributors_url":"https://api.github.com/repos/avantcredit/saseo/contributors","subscribers_url":"https://api.github.com/repos/avantcredit/saseo/subscribers","subscription_url":"https://api.github.com/repos/avantcredit/saseo/subscription","commits_url":"https://api.github.com/repos/avantcredit/saseo/commits{/sha}","git_commits_url":"https://api.github.com/repos/avantcredit/saseo/git/commits{/sha}","comments_url":"https://api.github.com/repos/avantcredit/saseo/comments{/number}","issue_comment_url":"https://api.github.com/repos/avantcredit/saseo/issues/comments{/number}","contents_url":"https://api.github.com/repos/avantcredit/saseo/contents/{+path}","compare_url":"https://api.github.com/repos/avantcredit/saseo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avantcredit/saseo/merges","archive_url":"https://api.github.com/repos/avantcredit/saseo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avantcredit/saseo/downloads","issues_url":"https://api.github.com/repos/avantcredit/saseo/issues{/number}","pulls_url":"https://api.github.com/repos/avantcredit/saseo/pulls{/number}","milestones_url":"https://api.github.com/repos/avantcredit/saseo/milestones{/number}","notifications_url":"https://api.github.com/repos/avantcredit/saseo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avantcredit/saseo/labels{/name}","releases_url":"https://api.github.com/repos/avantcredit/saseo/releases{/id}","created_at":"2015-10-21T19:56:39Z","updated_at":"2015-10-22T19:32:44Z","pushed_at":"2015-11-10T00:56:46Z","git_url":"git://github.com/avantcredit/saseo.git","ssh_url":"git@github.com:avantcredit/saseo.git","clone_url":"https://github.com/avantcredit/saseo.git","svn_url":"https://github.com/avantcredit/saseo","homepage":null,"size":443,"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":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/avantcredit/saseo/pulls/12"},"html":{"href":"https://github.com/avantcredit/saseo/pull/12"},"issue":{"href":"https://api.github.com/repos/avantcredit/saseo/issues/12"},"comments":{"href":"https://api.github.com/repos/avantcredit/saseo/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/avantcredit/saseo/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/avantcredit/saseo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/avantcredit/saseo/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/avantcredit/saseo/statuses/ad8350f329797c7e1e0246e936ba93ed36b2faaf"}}}}