{"action":"created","comment":{"url":"https://api.github.com/repos/Enkei92/test_app/pulls/comments/184946536","pull_request_review_id":116233588,"id":184946536,"diff_hunk":"@@ -1,12 +1,21 @@\n class AccountsController < ApplicationController\n   before_action :set_account, only: %i[show edit update destroy]\n+  before_action :set_status, only: %i[edit update]\n \n   def index\n     @accounts = Account.all\n   end\n \n+  def edit\n+    if current_account.role != 'admin' && @account.status != 'no_letter'\n+      redirect_to @account\n+    end\n+  end\n+\n   def update\n     if @account.update_attributes(account_params)\n+      AccountMailer.send_profile_email(@account).deliver\n+      AccountMailer.send_admin_profile_email(@account).deliver","path":"app/controllers/accounts_controller.rb","position":18,"original_position":18,"commit_id":"9c1de10b522699db4cf3c535b8d5dbc7e94693e8","original_commit_id":"9c1de10b522699db4cf3c535b8d5dbc7e94693e8","user":{"login":"macmaczhl","id":12204499,"avatar_url":"https://avatars3.githubusercontent.com/u/12204499?v=4","gravatar_id":"","url":"https://api.github.com/users/macmaczhl","html_url":"https://github.com/macmaczhl","followers_url":"https://api.github.com/users/macmaczhl/followers","following_url":"https://api.github.com/users/macmaczhl/following{/other_user}","gists_url":"https://api.github.com/users/macmaczhl/gists{/gist_id}","starred_url":"https://api.github.com/users/macmaczhl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macmaczhl/subscriptions","organizations_url":"https://api.github.com/users/macmaczhl/orgs","repos_url":"https://api.github.com/users/macmaczhl/repos","events_url":"https://api.github.com/users/macmaczhl/events{/privacy}","received_events_url":"https://api.github.com/users/macmaczhl/received_events","type":"User","site_admin":false},"body":"+ Для обоих случаев не нужно отправлять их сразу. Это нагрузка. Тебе нужно `deliver_later`. \r\nСтавь sidekiq","created_at":"2018-04-30T09:45:19Z","updated_at":"2018-04-30T09:46:41Z","html_url":"https://github.com/Enkei92/test_app/pull/3#discussion_r184946536","pull_request_url":"https://api.github.com/repos/Enkei92/test_app/pulls/3","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Enkei92/test_app/pulls/comments/184946536"},"html":{"href":"https://github.com/Enkei92/test_app/pull/3#discussion_r184946536"},"pull_request":{"href":"https://api.github.com/repos/Enkei92/test_app/pulls/3"}},"in_reply_to_id":184942893},"pull_request":{"url":"https://api.github.com/repos/Enkei92/test_app/pulls/3","id":184669172,"html_url":"https://github.com/Enkei92/test_app/pull/3","diff_url":"https://github.com/Enkei92/test_app/pull/3.diff","patch_url":"https://github.com/Enkei92/test_app/pull/3.patch","issue_url":"https://api.github.com/repos/Enkei92/test_app/issues/3","number":3,"state":"open","locked":false,"title":"Mailer","user":{"login":"Enkei92","id":15032447,"avatar_url":"https://avatars0.githubusercontent.com/u/15032447?v=4","gravatar_id":"","url":"https://api.github.com/users/Enkei92","html_url":"https://github.com/Enkei92","followers_url":"https://api.github.com/users/Enkei92/followers","following_url":"https://api.github.com/users/Enkei92/following{/other_user}","gists_url":"https://api.github.com/users/Enkei92/gists{/gist_id}","starred_url":"https://api.github.com/users/Enkei92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Enkei92/subscriptions","organizations_url":"https://api.github.com/users/Enkei92/orgs","repos_url":"https://api.github.com/users/Enkei92/repos","events_url":"https://api.github.com/users/Enkei92/events{/privacy}","received_events_url":"https://api.github.com/users/Enkei92/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-27T16:25:34Z","updated_at":"2018-04-30T09:46:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb255a0359210aee9d00ad361561b4e5fee29753","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Enkei92/test_app/pulls/3/commits","review_comments_url":"https://api.github.com/repos/Enkei92/test_app/pulls/3/comments","review_comment_url":"https://api.github.com/repos/Enkei92/test_app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Enkei92/test_app/issues/3/comments","statuses_url":"https://api.github.com/repos/Enkei92/test_app/statuses/9c1de10b522699db4cf3c535b8d5dbc7e94693e8","head":{"label":"Enkei92:authorization","ref":"authorization","sha":"9c1de10b522699db4cf3c535b8d5dbc7e94693e8","user":{"login":"Enkei92","id":15032447,"avatar_url":"https://avatars0.githubusercontent.com/u/15032447?v=4","gravatar_id":"","url":"https://api.github.com/users/Enkei92","html_url":"https://github.com/Enkei92","followers_url":"https://api.github.com/users/Enkei92/followers","following_url":"https://api.github.com/users/Enkei92/following{/other_user}","gists_url":"https://api.github.com/users/Enkei92/gists{/gist_id}","starred_url":"https://api.github.com/users/Enkei92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Enkei92/subscriptions","organizations_url":"https://api.github.com/users/Enkei92/orgs","repos_url":"https://api.github.com/users/Enkei92/repos","events_url":"https://api.github.com/users/Enkei92/events{/privacy}","received_events_url":"https://api.github.com/users/Enkei92/received_events","type":"User","site_admin":false},"repo":{"id":130335254,"name":"test_app","full_name":"Enkei92/test_app","owner":{"login":"Enkei92","id":15032447,"avatar_url":"https://avatars0.githubusercontent.com/u/15032447?v=4","gravatar_id":"","url":"https://api.github.com/users/Enkei92","html_url":"https://github.com/Enkei92","followers_url":"https://api.github.com/users/Enkei92/followers","following_url":"https://api.github.com/users/Enkei92/following{/other_user}","gists_url":"https://api.github.com/users/Enkei92/gists{/gist_id}","starred_url":"https://api.github.com/users/Enkei92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Enkei92/subscriptions","organizations_url":"https://api.github.com/users/Enkei92/orgs","repos_url":"https://api.github.com/users/Enkei92/repos","events_url":"https://api.github.com/users/Enkei92/events{/privacy}","received_events_url":"https://api.github.com/users/Enkei92/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Enkei92/test_app","description":null,"fork":false,"url":"https://api.github.com/repos/Enkei92/test_app","forks_url":"https://api.github.com/repos/Enkei92/test_app/forks","keys_url":"https://api.github.com/repos/Enkei92/test_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Enkei92/test_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Enkei92/test_app/teams","hooks_url":"https://api.github.com/repos/Enkei92/test_app/hooks","issue_events_url":"https://api.github.com/repos/Enkei92/test_app/issues/events{/number}","events_url":"https://api.github.com/repos/Enkei92/test_app/events","assignees_url":"https://api.github.com/repos/Enkei92/test_app/assignees{/user}","branches_url":"https://api.github.com/repos/Enkei92/test_app/branches{/branch}","tags_url":"https://api.github.com/repos/Enkei92/test_app/tags","blobs_url":"https://api.github.com/repos/Enkei92/test_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Enkei92/test_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Enkei92/test_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/Enkei92/test_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Enkei92/test_app/statuses/{sha}","languages_url":"https://api.github.com/repos/Enkei92/test_app/languages","stargazers_url":"https://api.github.com/repos/Enkei92/test_app/stargazers","contributors_url":"https://api.github.com/repos/Enkei92/test_app/contributors","subscribers_url":"https://api.github.com/repos/Enkei92/test_app/subscribers","subscription_url":"https://api.github.com/repos/Enkei92/test_app/subscription","commits_url":"https://api.github.com/repos/Enkei92/test_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/Enkei92/test_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/Enkei92/test_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/Enkei92/test_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/Enkei92/test_app/contents/{+path}","compare_url":"https://api.github.com/repos/Enkei92/test_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Enkei92/test_app/merges","archive_url":"https://api.github.com/repos/Enkei92/test_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Enkei92/test_app/downloads","issues_url":"https://api.github.com/repos/Enkei92/test_app/issues{/number}","pulls_url":"https://api.github.com/repos/Enkei92/test_app/pulls{/number}","milestones_url":"https://api.github.com/repos/Enkei92/test_app/milestones{/number}","notifications_url":"https://api.github.com/repos/Enkei92/test_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Enkei92/test_app/labels{/name}","releases_url":"https://api.github.com/repos/Enkei92/test_app/releases{/id}","deployments_url":"https://api.github.com/repos/Enkei92/test_app/deployments","created_at":"2018-04-20T08:44:14Z","updated_at":"2018-04-27T13:12:31Z","pushed_at":"2018-04-27T16:25:34Z","git_url":"git://github.com/Enkei92/test_app.git","ssh_url":"git@github.com:Enkei92/test_app.git","clone_url":"https://github.com/Enkei92/test_app.git","svn_url":"https://github.com/Enkei92/test_app","homepage":null,"size":82,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Enkei92:master","ref":"master","sha":"9affaeb65f0048c4647061f574646ab3f2606cd7","user":{"login":"Enkei92","id":15032447,"avatar_url":"https://avatars0.githubusercontent.com/u/15032447?v=4","gravatar_id":"","url":"https://api.github.com/users/Enkei92","html_url":"https://github.com/Enkei92","followers_url":"https://api.github.com/users/Enkei92/followers","following_url":"https://api.github.com/users/Enkei92/following{/other_user}","gists_url":"https://api.github.com/users/Enkei92/gists{/gist_id}","starred_url":"https://api.github.com/users/Enkei92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Enkei92/subscriptions","organizations_url":"https://api.github.com/users/Enkei92/orgs","repos_url":"https://api.github.com/users/Enkei92/repos","events_url":"https://api.github.com/users/Enkei92/events{/privacy}","received_events_url":"https://api.github.com/users/Enkei92/received_events","type":"User","site_admin":false},"repo":{"id":130335254,"name":"test_app","full_name":"Enkei92/test_app","owner":{"login":"Enkei92","id":15032447,"avatar_url":"https://avatars0.githubusercontent.com/u/15032447?v=4","gravatar_id":"","url":"https://api.github.com/users/Enkei92","html_url":"https://github.com/Enkei92","followers_url":"https://api.github.com/users/Enkei92/followers","following_url":"https://api.github.com/users/Enkei92/following{/other_user}","gists_url":"https://api.github.com/users/Enkei92/gists{/gist_id}","starred_url":"https://api.github.com/users/Enkei92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Enkei92/subscriptions","organizations_url":"https://api.github.com/users/Enkei92/orgs","repos_url":"https://api.github.com/users/Enkei92/repos","events_url":"https://api.github.com/users/Enkei92/events{/privacy}","received_events_url":"https://api.github.com/users/Enkei92/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Enkei92/test_app","description":null,"fork":false,"url":"https://api.github.com/repos/Enkei92/test_app","forks_url":"https://api.github.com/repos/Enkei92/test_app/forks","keys_url":"https://api.github.com/repos/Enkei92/test_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Enkei92/test_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Enkei92/test_app/teams","hooks_url":"https://api.github.com/repos/Enkei92/test_app/hooks","issue_events_url":"https://api.github.com/repos/Enkei92/test_app/issues/events{/number}","events_url":"https://api.github.com/repos/Enkei92/test_app/events","assignees_url":"https://api.github.com/repos/Enkei92/test_app/assignees{/user}","branches_url":"https://api.github.com/repos/Enkei92/test_app/branches{/branch}","tags_url":"https://api.github.com/repos/Enkei92/test_app/tags","blobs_url":"https://api.github.com/repos/Enkei92/test_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Enkei92/test_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Enkei92/test_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/Enkei92/test_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Enkei92/test_app/statuses/{sha}","languages_url":"https://api.github.com/repos/Enkei92/test_app/languages","stargazers_url":"https://api.github.com/repos/Enkei92/test_app/stargazers","contributors_url":"https://api.github.com/repos/Enkei92/test_app/contributors","subscribers_url":"https://api.github.com/repos/Enkei92/test_app/subscribers","subscription_url":"https://api.github.com/repos/Enkei92/test_app/subscription","commits_url":"https://api.github.com/repos/Enkei92/test_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/Enkei92/test_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/Enkei92/test_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/Enkei92/test_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/Enkei92/test_app/contents/{+path}","compare_url":"https://api.github.com/repos/Enkei92/test_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Enkei92/test_app/merges","archive_url":"https://api.github.com/repos/Enkei92/test_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Enkei92/test_app/downloads","issues_url":"https://api.github.com/repos/Enkei92/test_app/issues{/number}","pulls_url":"https://api.github.com/repos/Enkei92/test_app/pulls{/number}","milestones_url":"https://api.github.com/repos/Enkei92/test_app/milestones{/number}","notifications_url":"https://api.github.com/repos/Enkei92/test_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Enkei92/test_app/labels{/name}","releases_url":"https://api.github.com/repos/Enkei92/test_app/releases{/id}","deployments_url":"https://api.github.com/repos/Enkei92/test_app/deployments","created_at":"2018-04-20T08:44:14Z","updated_at":"2018-04-27T13:12:31Z","pushed_at":"2018-04-27T16:25:34Z","git_url":"git://github.com/Enkei92/test_app.git","ssh_url":"git@github.com:Enkei92/test_app.git","clone_url":"https://github.com/Enkei92/test_app.git","svn_url":"https://github.com/Enkei92/test_app","homepage":null,"size":82,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Enkei92/test_app/pulls/3"},"html":{"href":"https://github.com/Enkei92/test_app/pull/3"},"issue":{"href":"https://api.github.com/repos/Enkei92/test_app/issues/3"},"comments":{"href":"https://api.github.com/repos/Enkei92/test_app/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/Enkei92/test_app/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/Enkei92/test_app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Enkei92/test_app/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/Enkei92/test_app/statuses/9c1de10b522699db4cf3c535b8d5dbc7e94693e8"}},"author_association":"OWNER"}}
{"actor":{"display_login":"macmaczhl"}}