{"action":"created","comment":{"url":"https://api.github.com/repos/oblaka/qna/pulls/comments/37143000","id":37143000,"diff_hunk":"@@ -0,0 +1,9 @@\n+class DailyDigestJob < ActiveJob::Base\n+  queue_as :default\n+\n+  def perform\n+    User.find_each do |user|\n+      DigestMailer.daily(user).deliver_now","path":"app/jobs/daily_digest_job.rb","position":6,"original_position":6,"commit_id":"f4b6cab5ad904d40233bef27728e09c192e195a5","original_commit_id":"f4b6cab5ad904d40233bef27728e09c192e195a5","user":{"login":"palkan","id":1516722,"avatar_url":"https://avatars.githubusercontent.com/u/1516722?v=3","gravatar_id":"","url":"https://api.github.com/users/palkan","html_url":"https://github.com/palkan","followers_url":"https://api.github.com/users/palkan/followers","following_url":"https://api.github.com/users/palkan/following{/other_user}","gists_url":"https://api.github.com/users/palkan/gists{/gist_id}","starred_url":"https://api.github.com/users/palkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palkan/subscriptions","organizations_url":"https://api.github.com/users/palkan/orgs","repos_url":"https://api.github.com/users/palkan/repos","events_url":"https://api.github.com/users/palkan/events{/privacy}","received_events_url":"https://api.github.com/users/palkan/received_events","type":"User","site_admin":false},"body":"Здесь лучше тоже использовать  `deliver_later`, так сообщения попадут в очередь и уже из очереди будут отправлены.\r\nСейчас идет отправка в цикле, а это может _подвесить_ приложение, если пользователей будет много.","created_at":"2015-08-16T07:30:26Z","updated_at":"2015-08-16T07:30:26Z","html_url":"https://github.com/oblaka/qna/pull/15#discussion_r37143000","pull_request_url":"https://api.github.com/repos/oblaka/qna/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/oblaka/qna/pulls/comments/37143000"},"html":{"href":"https://github.com/oblaka/qna/pull/15#discussion_r37143000"},"pull_request":{"href":"https://api.github.com/repos/oblaka/qna/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/oblaka/qna/pulls/15","id":42522464,"html_url":"https://github.com/oblaka/qna/pull/15","diff_url":"https://github.com/oblaka/qna/pull/15.diff","patch_url":"https://github.com/oblaka/qna/pull/15.patch","issue_url":"https://api.github.com/repos/oblaka/qna/issues/15","number":15,"state":"open","locked":false,"title":"Lesson17","user":{"login":"oblaka","id":5460740,"avatar_url":"https://avatars.githubusercontent.com/u/5460740?v=3","gravatar_id":"","url":"https://api.github.com/users/oblaka","html_url":"https://github.com/oblaka","followers_url":"https://api.github.com/users/oblaka/followers","following_url":"https://api.github.com/users/oblaka/following{/other_user}","gists_url":"https://api.github.com/users/oblaka/gists{/gist_id}","starred_url":"https://api.github.com/users/oblaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oblaka/subscriptions","organizations_url":"https://api.github.com/users/oblaka/orgs","repos_url":"https://api.github.com/users/oblaka/repos","events_url":"https://api.github.com/users/oblaka/events{/privacy}","received_events_url":"https://api.github.com/users/oblaka/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-15T17:15:22Z","updated_at":"2015-08-16T07:30:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a17fd6371452a0296014d47f1bd85c9a0ae5b68","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/oblaka/qna/pulls/15/commits","review_comments_url":"https://api.github.com/repos/oblaka/qna/pulls/15/comments","review_comment_url":"https://api.github.com/repos/oblaka/qna/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oblaka/qna/issues/15/comments","statuses_url":"https://api.github.com/repos/oblaka/qna/statuses/f4b6cab5ad904d40233bef27728e09c192e195a5","head":{"label":"oblaka:lesson17","ref":"lesson17","sha":"f4b6cab5ad904d40233bef27728e09c192e195a5","user":{"login":"oblaka","id":5460740,"avatar_url":"https://avatars.githubusercontent.com/u/5460740?v=3","gravatar_id":"","url":"https://api.github.com/users/oblaka","html_url":"https://github.com/oblaka","followers_url":"https://api.github.com/users/oblaka/followers","following_url":"https://api.github.com/users/oblaka/following{/other_user}","gists_url":"https://api.github.com/users/oblaka/gists{/gist_id}","starred_url":"https://api.github.com/users/oblaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oblaka/subscriptions","organizations_url":"https://api.github.com/users/oblaka/orgs","repos_url":"https://api.github.com/users/oblaka/repos","events_url":"https://api.github.com/users/oblaka/events{/privacy}","received_events_url":"https://api.github.com/users/oblaka/received_events","type":"User","site_admin":false},"repo":{"id":36626152,"name":"qna","full_name":"oblaka/qna","owner":{"login":"oblaka","id":5460740,"avatar_url":"https://avatars.githubusercontent.com/u/5460740?v=3","gravatar_id":"","url":"https://api.github.com/users/oblaka","html_url":"https://github.com/oblaka","followers_url":"https://api.github.com/users/oblaka/followers","following_url":"https://api.github.com/users/oblaka/following{/other_user}","gists_url":"https://api.github.com/users/oblaka/gists{/gist_id}","starred_url":"https://api.github.com/users/oblaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oblaka/subscriptions","organizations_url":"https://api.github.com/users/oblaka/orgs","repos_url":"https://api.github.com/users/oblaka/repos","events_url":"https://api.github.com/users/oblaka/events{/privacy}","received_events_url":"https://api.github.com/users/oblaka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oblaka/qna","description":"Thinknetica course project","fork":false,"url":"https://api.github.com/repos/oblaka/qna","forks_url":"https://api.github.com/repos/oblaka/qna/forks","keys_url":"https://api.github.com/repos/oblaka/qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oblaka/qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oblaka/qna/teams","hooks_url":"https://api.github.com/repos/oblaka/qna/hooks","issue_events_url":"https://api.github.com/repos/oblaka/qna/issues/events{/number}","events_url":"https://api.github.com/repos/oblaka/qna/events","assignees_url":"https://api.github.com/repos/oblaka/qna/assignees{/user}","branches_url":"https://api.github.com/repos/oblaka/qna/branches{/branch}","tags_url":"https://api.github.com/repos/oblaka/qna/tags","blobs_url":"https://api.github.com/repos/oblaka/qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oblaka/qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oblaka/qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/oblaka/qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oblaka/qna/statuses/{sha}","languages_url":"https://api.github.com/repos/oblaka/qna/languages","stargazers_url":"https://api.github.com/repos/oblaka/qna/stargazers","contributors_url":"https://api.github.com/repos/oblaka/qna/contributors","subscribers_url":"https://api.github.com/repos/oblaka/qna/subscribers","subscription_url":"https://api.github.com/repos/oblaka/qna/subscription","commits_url":"https://api.github.com/repos/oblaka/qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/oblaka/qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/oblaka/qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/oblaka/qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/oblaka/qna/contents/{+path}","compare_url":"https://api.github.com/repos/oblaka/qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oblaka/qna/merges","archive_url":"https://api.github.com/repos/oblaka/qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oblaka/qna/downloads","issues_url":"https://api.github.com/repos/oblaka/qna/issues{/number}","pulls_url":"https://api.github.com/repos/oblaka/qna/pulls{/number}","milestones_url":"https://api.github.com/repos/oblaka/qna/milestones{/number}","notifications_url":"https://api.github.com/repos/oblaka/qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oblaka/qna/labels{/name}","releases_url":"https://api.github.com/repos/oblaka/qna/releases{/id}","created_at":"2015-05-31T23:05:35Z","updated_at":"2015-05-31T23:05:41Z","pushed_at":"2015-08-15T17:15:22Z","git_url":"git://github.com/oblaka/qna.git","ssh_url":"git@github.com:oblaka/qna.git","clone_url":"https://github.com/oblaka/qna.git","svn_url":"https://github.com/oblaka/qna","homepage":null,"size":660,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"oblaka:master","ref":"master","sha":"0036be04143ca04c3e8eba10cb69f3de990c09ea","user":{"login":"oblaka","id":5460740,"avatar_url":"https://avatars.githubusercontent.com/u/5460740?v=3","gravatar_id":"","url":"https://api.github.com/users/oblaka","html_url":"https://github.com/oblaka","followers_url":"https://api.github.com/users/oblaka/followers","following_url":"https://api.github.com/users/oblaka/following{/other_user}","gists_url":"https://api.github.com/users/oblaka/gists{/gist_id}","starred_url":"https://api.github.com/users/oblaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oblaka/subscriptions","organizations_url":"https://api.github.com/users/oblaka/orgs","repos_url":"https://api.github.com/users/oblaka/repos","events_url":"https://api.github.com/users/oblaka/events{/privacy}","received_events_url":"https://api.github.com/users/oblaka/received_events","type":"User","site_admin":false},"repo":{"id":36626152,"name":"qna","full_name":"oblaka/qna","owner":{"login":"oblaka","id":5460740,"avatar_url":"https://avatars.githubusercontent.com/u/5460740?v=3","gravatar_id":"","url":"https://api.github.com/users/oblaka","html_url":"https://github.com/oblaka","followers_url":"https://api.github.com/users/oblaka/followers","following_url":"https://api.github.com/users/oblaka/following{/other_user}","gists_url":"https://api.github.com/users/oblaka/gists{/gist_id}","starred_url":"https://api.github.com/users/oblaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oblaka/subscriptions","organizations_url":"https://api.github.com/users/oblaka/orgs","repos_url":"https://api.github.com/users/oblaka/repos","events_url":"https://api.github.com/users/oblaka/events{/privacy}","received_events_url":"https://api.github.com/users/oblaka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oblaka/qna","description":"Thinknetica course project","fork":false,"url":"https://api.github.com/repos/oblaka/qna","forks_url":"https://api.github.com/repos/oblaka/qna/forks","keys_url":"https://api.github.com/repos/oblaka/qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oblaka/qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oblaka/qna/teams","hooks_url":"https://api.github.com/repos/oblaka/qna/hooks","issue_events_url":"https://api.github.com/repos/oblaka/qna/issues/events{/number}","events_url":"https://api.github.com/repos/oblaka/qna/events","assignees_url":"https://api.github.com/repos/oblaka/qna/assignees{/user}","branches_url":"https://api.github.com/repos/oblaka/qna/branches{/branch}","tags_url":"https://api.github.com/repos/oblaka/qna/tags","blobs_url":"https://api.github.com/repos/oblaka/qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oblaka/qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oblaka/qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/oblaka/qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oblaka/qna/statuses/{sha}","languages_url":"https://api.github.com/repos/oblaka/qna/languages","stargazers_url":"https://api.github.com/repos/oblaka/qna/stargazers","contributors_url":"https://api.github.com/repos/oblaka/qna/contributors","subscribers_url":"https://api.github.com/repos/oblaka/qna/subscribers","subscription_url":"https://api.github.com/repos/oblaka/qna/subscription","commits_url":"https://api.github.com/repos/oblaka/qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/oblaka/qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/oblaka/qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/oblaka/qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/oblaka/qna/contents/{+path}","compare_url":"https://api.github.com/repos/oblaka/qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oblaka/qna/merges","archive_url":"https://api.github.com/repos/oblaka/qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oblaka/qna/downloads","issues_url":"https://api.github.com/repos/oblaka/qna/issues{/number}","pulls_url":"https://api.github.com/repos/oblaka/qna/pulls{/number}","milestones_url":"https://api.github.com/repos/oblaka/qna/milestones{/number}","notifications_url":"https://api.github.com/repos/oblaka/qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oblaka/qna/labels{/name}","releases_url":"https://api.github.com/repos/oblaka/qna/releases{/id}","created_at":"2015-05-31T23:05:35Z","updated_at":"2015-05-31T23:05:41Z","pushed_at":"2015-08-15T17:15:22Z","git_url":"git://github.com/oblaka/qna.git","ssh_url":"git@github.com:oblaka/qna.git","clone_url":"https://github.com/oblaka/qna.git","svn_url":"https://github.com/oblaka/qna","homepage":null,"size":660,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/oblaka/qna/pulls/15"},"html":{"href":"https://github.com/oblaka/qna/pull/15"},"issue":{"href":"https://api.github.com/repos/oblaka/qna/issues/15"},"comments":{"href":"https://api.github.com/repos/oblaka/qna/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/oblaka/qna/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/oblaka/qna/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oblaka/qna/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/oblaka/qna/statuses/f4b6cab5ad904d40233bef27728e09c192e195a5"}}}}