{"action":"created","comment":{"url":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/comments/86660551","pull_request_review_id":7310590,"id":86660551,"diff_hunk":"@@ -106,10 +106,34 @@ def update\n       current_user.update_attribute(:default_group, nil)\n     end\n \n-    if @user_group.update!(update_params)\n-      redirect_to @user_group\n+    integrations = JSON.parse(params[:integrations]).with_indifferent_access\n+    slack = integrations[:slack]\n+    api_token = slack[:api_token]\n+    slackbot = @user_group.slack_bot\n+\n+    if api_token\n+      slackbot ||= SlackBot.create(user_group: @user_group)\n+      slackbot.slack_messages = slack[:message_types].map do |type, message_params|\n+        message = slackbot.slack_messages.find_or_create_by(message_type: type)\n+\n+        message.tap do |updated_message|\n+          message.update!(message_params)\n+        end\n+      end\n+      slackbot.update!(api_token: api_token)\n     else\n-      render action: :edit\n+      slackbot.destroy if slackbot\n+    end\n+\n+    if @user_group.update(update_params)\n+      head :ok\n+    else\n+      error_data =  {","path":"app/controllers/user_groups_controller.rb","position":55,"original_position":55,"commit_id":"3363f6e233a3a10a16207677c11a9318bb19efa1","original_commit_id":"3363f6e233a3a10a16207677c11a9318bb19efa1","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Operator = should be surrounded by a single space.<br>Unnecessary spacing detected.","created_at":"2016-11-05T08:25:39Z","updated_at":"2016-11-05T08:25:39Z","html_url":"https://github.com/danReynolds/SupermarKit/pull/133#discussion_r86660551","pull_request_url":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/133","_links":{"self":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/comments/86660551"},"html":{"href":"https://github.com/danReynolds/SupermarKit/pull/133#discussion_r86660551"},"pull_request":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/133"}}},"pull_request":{"url":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/133","id":92446626,"html_url":"https://github.com/danReynolds/SupermarKit/pull/133","diff_url":"https://github.com/danReynolds/SupermarKit/pull/133.diff","patch_url":"https://github.com/danReynolds/SupermarKit/pull/133.patch","issue_url":"https://api.github.com/repos/danReynolds/SupermarKit/issues/133","number":133,"state":"open","locked":false,"title":"Feature/slack integration","user":{"login":"danReynolds","id":2192930,"avatar_url":"https://avatars.githubusercontent.com/u/2192930?v=3","gravatar_id":"","url":"https://api.github.com/users/danReynolds","html_url":"https://github.com/danReynolds","followers_url":"https://api.github.com/users/danReynolds/followers","following_url":"https://api.github.com/users/danReynolds/following{/other_user}","gists_url":"https://api.github.com/users/danReynolds/gists{/gist_id}","starred_url":"https://api.github.com/users/danReynolds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danReynolds/subscriptions","organizations_url":"https://api.github.com/users/danReynolds/orgs","repos_url":"https://api.github.com/users/danReynolds/repos","events_url":"https://api.github.com/users/danReynolds/events{/privacy}","received_events_url":"https://api.github.com/users/danReynolds/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-05T08:25:28Z","updated_at":"2016-11-05T08:25:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a45b41dcac4bbc1fbbd6930b6d56ef44a55e58af","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/133/commits","review_comments_url":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/133/comments","review_comment_url":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/danReynolds/SupermarKit/issues/133/comments","statuses_url":"https://api.github.com/repos/danReynolds/SupermarKit/statuses/3363f6e233a3a10a16207677c11a9318bb19efa1","head":{"label":"danReynolds:feature/slackIntegration","ref":"feature/slackIntegration","sha":"3363f6e233a3a10a16207677c11a9318bb19efa1","user":{"login":"danReynolds","id":2192930,"avatar_url":"https://avatars.githubusercontent.com/u/2192930?v=3","gravatar_id":"","url":"https://api.github.com/users/danReynolds","html_url":"https://github.com/danReynolds","followers_url":"https://api.github.com/users/danReynolds/followers","following_url":"https://api.github.com/users/danReynolds/following{/other_user}","gists_url":"https://api.github.com/users/danReynolds/gists{/gist_id}","starred_url":"https://api.github.com/users/danReynolds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danReynolds/subscriptions","organizations_url":"https://api.github.com/users/danReynolds/orgs","repos_url":"https://api.github.com/users/danReynolds/repos","events_url":"https://api.github.com/users/danReynolds/events{/privacy}","received_events_url":"https://api.github.com/users/danReynolds/received_events","type":"User","site_admin":false},"repo":{"id":27952521,"name":"SupermarKit","full_name":"danReynolds/SupermarKit","owner":{"login":"danReynolds","id":2192930,"avatar_url":"https://avatars.githubusercontent.com/u/2192930?v=3","gravatar_id":"","url":"https://api.github.com/users/danReynolds","html_url":"https://github.com/danReynolds","followers_url":"https://api.github.com/users/danReynolds/followers","following_url":"https://api.github.com/users/danReynolds/following{/other_user}","gists_url":"https://api.github.com/users/danReynolds/gists{/gist_id}","starred_url":"https://api.github.com/users/danReynolds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danReynolds/subscriptions","organizations_url":"https://api.github.com/users/danReynolds/orgs","repos_url":"https://api.github.com/users/danReynolds/repos","events_url":"https://api.github.com/users/danReynolds/events{/privacy}","received_events_url":"https://api.github.com/users/danReynolds/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danReynolds/SupermarKit","description":"SupermarKit - a grocery tracking and management app","fork":false,"url":"https://api.github.com/repos/danReynolds/SupermarKit","forks_url":"https://api.github.com/repos/danReynolds/SupermarKit/forks","keys_url":"https://api.github.com/repos/danReynolds/SupermarKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danReynolds/SupermarKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danReynolds/SupermarKit/teams","hooks_url":"https://api.github.com/repos/danReynolds/SupermarKit/hooks","issue_events_url":"https://api.github.com/repos/danReynolds/SupermarKit/issues/events{/number}","events_url":"https://api.github.com/repos/danReynolds/SupermarKit/events","assignees_url":"https://api.github.com/repos/danReynolds/SupermarKit/assignees{/user}","branches_url":"https://api.github.com/repos/danReynolds/SupermarKit/branches{/branch}","tags_url":"https://api.github.com/repos/danReynolds/SupermarKit/tags","blobs_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danReynolds/SupermarKit/statuses/{sha}","languages_url":"https://api.github.com/repos/danReynolds/SupermarKit/languages","stargazers_url":"https://api.github.com/repos/danReynolds/SupermarKit/stargazers","contributors_url":"https://api.github.com/repos/danReynolds/SupermarKit/contributors","subscribers_url":"https://api.github.com/repos/danReynolds/SupermarKit/subscribers","subscription_url":"https://api.github.com/repos/danReynolds/SupermarKit/subscription","commits_url":"https://api.github.com/repos/danReynolds/SupermarKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/danReynolds/SupermarKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/danReynolds/SupermarKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/danReynolds/SupermarKit/contents/{+path}","compare_url":"https://api.github.com/repos/danReynolds/SupermarKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danReynolds/SupermarKit/merges","archive_url":"https://api.github.com/repos/danReynolds/SupermarKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danReynolds/SupermarKit/downloads","issues_url":"https://api.github.com/repos/danReynolds/SupermarKit/issues{/number}","pulls_url":"https://api.github.com/repos/danReynolds/SupermarKit/pulls{/number}","milestones_url":"https://api.github.com/repos/danReynolds/SupermarKit/milestones{/number}","notifications_url":"https://api.github.com/repos/danReynolds/SupermarKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danReynolds/SupermarKit/labels{/name}","releases_url":"https://api.github.com/repos/danReynolds/SupermarKit/releases{/id}","deployments_url":"https://api.github.com/repos/danReynolds/SupermarKit/deployments","created_at":"2014-12-13T06:56:32Z","updated_at":"2016-10-28T05:56:19Z","pushed_at":"2016-11-05T08:25:28Z","git_url":"git://github.com/danReynolds/SupermarKit.git","ssh_url":"git@github.com:danReynolds/SupermarKit.git","clone_url":"https://github.com/danReynolds/SupermarKit.git","svn_url":"https://github.com/danReynolds/SupermarKit","homepage":"https://supermarkit.io","size":101411,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":17,"forks":5,"open_issues":17,"watchers":4,"default_branch":"master"}},"base":{"label":"danReynolds:master","ref":"master","sha":"2a599f8543d012de75271fe60428297d555e4a3e","user":{"login":"danReynolds","id":2192930,"avatar_url":"https://avatars.githubusercontent.com/u/2192930?v=3","gravatar_id":"","url":"https://api.github.com/users/danReynolds","html_url":"https://github.com/danReynolds","followers_url":"https://api.github.com/users/danReynolds/followers","following_url":"https://api.github.com/users/danReynolds/following{/other_user}","gists_url":"https://api.github.com/users/danReynolds/gists{/gist_id}","starred_url":"https://api.github.com/users/danReynolds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danReynolds/subscriptions","organizations_url":"https://api.github.com/users/danReynolds/orgs","repos_url":"https://api.github.com/users/danReynolds/repos","events_url":"https://api.github.com/users/danReynolds/events{/privacy}","received_events_url":"https://api.github.com/users/danReynolds/received_events","type":"User","site_admin":false},"repo":{"id":27952521,"name":"SupermarKit","full_name":"danReynolds/SupermarKit","owner":{"login":"danReynolds","id":2192930,"avatar_url":"https://avatars.githubusercontent.com/u/2192930?v=3","gravatar_id":"","url":"https://api.github.com/users/danReynolds","html_url":"https://github.com/danReynolds","followers_url":"https://api.github.com/users/danReynolds/followers","following_url":"https://api.github.com/users/danReynolds/following{/other_user}","gists_url":"https://api.github.com/users/danReynolds/gists{/gist_id}","starred_url":"https://api.github.com/users/danReynolds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danReynolds/subscriptions","organizations_url":"https://api.github.com/users/danReynolds/orgs","repos_url":"https://api.github.com/users/danReynolds/repos","events_url":"https://api.github.com/users/danReynolds/events{/privacy}","received_events_url":"https://api.github.com/users/danReynolds/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danReynolds/SupermarKit","description":"SupermarKit - a grocery tracking and management app","fork":false,"url":"https://api.github.com/repos/danReynolds/SupermarKit","forks_url":"https://api.github.com/repos/danReynolds/SupermarKit/forks","keys_url":"https://api.github.com/repos/danReynolds/SupermarKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danReynolds/SupermarKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danReynolds/SupermarKit/teams","hooks_url":"https://api.github.com/repos/danReynolds/SupermarKit/hooks","issue_events_url":"https://api.github.com/repos/danReynolds/SupermarKit/issues/events{/number}","events_url":"https://api.github.com/repos/danReynolds/SupermarKit/events","assignees_url":"https://api.github.com/repos/danReynolds/SupermarKit/assignees{/user}","branches_url":"https://api.github.com/repos/danReynolds/SupermarKit/branches{/branch}","tags_url":"https://api.github.com/repos/danReynolds/SupermarKit/tags","blobs_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danReynolds/SupermarKit/statuses/{sha}","languages_url":"https://api.github.com/repos/danReynolds/SupermarKit/languages","stargazers_url":"https://api.github.com/repos/danReynolds/SupermarKit/stargazers","contributors_url":"https://api.github.com/repos/danReynolds/SupermarKit/contributors","subscribers_url":"https://api.github.com/repos/danReynolds/SupermarKit/subscribers","subscription_url":"https://api.github.com/repos/danReynolds/SupermarKit/subscription","commits_url":"https://api.github.com/repos/danReynolds/SupermarKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/danReynolds/SupermarKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/danReynolds/SupermarKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/danReynolds/SupermarKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/danReynolds/SupermarKit/contents/{+path}","compare_url":"https://api.github.com/repos/danReynolds/SupermarKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danReynolds/SupermarKit/merges","archive_url":"https://api.github.com/repos/danReynolds/SupermarKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danReynolds/SupermarKit/downloads","issues_url":"https://api.github.com/repos/danReynolds/SupermarKit/issues{/number}","pulls_url":"https://api.github.com/repos/danReynolds/SupermarKit/pulls{/number}","milestones_url":"https://api.github.com/repos/danReynolds/SupermarKit/milestones{/number}","notifications_url":"https://api.github.com/repos/danReynolds/SupermarKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danReynolds/SupermarKit/labels{/name}","releases_url":"https://api.github.com/repos/danReynolds/SupermarKit/releases{/id}","deployments_url":"https://api.github.com/repos/danReynolds/SupermarKit/deployments","created_at":"2014-12-13T06:56:32Z","updated_at":"2016-10-28T05:56:19Z","pushed_at":"2016-11-05T08:25:28Z","git_url":"git://github.com/danReynolds/SupermarKit.git","ssh_url":"git@github.com:danReynolds/SupermarKit.git","clone_url":"https://github.com/danReynolds/SupermarKit.git","svn_url":"https://github.com/danReynolds/SupermarKit","homepage":"https://supermarkit.io","size":101411,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":17,"forks":5,"open_issues":17,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/133"},"html":{"href":"https://github.com/danReynolds/SupermarKit/pull/133"},"issue":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/issues/133"},"comments":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/issues/133/comments"},"review_comments":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/133/comments"},"review_comment":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/pulls/133/commits"},"statuses":{"href":"https://api.github.com/repos/danReynolds/SupermarKit/statuses/3363f6e233a3a10a16207677c11a9318bb19efa1"}}}}
{"actor":{"display_login":"houndci-bot"}}