{"action":"created","comment":{"url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/pulls/comments/202934126","pull_request_review_id":137722492,"id":202934126,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjkzNDEyNg==","diff_hunk":"@@ -35,46 +35,26 @@ def edit\n \n   def update\n     if (user_params[:new_password] != '') || (user_params[:email] != @user.email)\n-      if user_params[:password] === ''\n-        @user.update(user_params)\n-        flash.now[:error] = \"Password is a mandatory field\"\n-        render :edit\n-      elsif @user.authenticated?(params[:user][:password])\n-        if @user.update(user_params)\n-          if user_params[:new_password] != ''\n-            @user.update_attributes(password: user_params[:new_password])\n-          end\n-          redirect_to edit_user_path(@user), notice: \"You have successfully updated your user data.\"\n-        else\n-          render :edit\n-        end\n-      else\n-        flash.now[:error] = \"Incorrect password\"\n-        render :edit\n-      end\n+      update_protected_params\n     else\n       @user.password_optional = true\n-      if @user.update(user_params)\n-        redirect_to edit_user_path(@user), notice: \"You have successfully updated your user data.\"\n-      else\n-        render :edit\n-      end\n+      @user.update(user_params)\n+      redirect_to edit_user_path(@user), notice: \"You have successfully updated your user data.\"\n     end","path":"app/controllers/users_controller.rb","position":31,"original_position":31,"commit_id":"d42f34121f5f60b22e8a0a254dfe9c2e4a4c773e","original_commit_id":"d42f34121f5f60b22e8a0a254dfe9c2e4a4c773e","user":{"login":"guainumbi","id":28188126,"node_id":"MDQ6VXNlcjI4MTg4MTI2","avatar_url":"https://avatars2.githubusercontent.com/u/28188126?v=4","gravatar_id":"","url":"https://api.github.com/users/guainumbi","html_url":"https://github.com/guainumbi","followers_url":"https://api.github.com/users/guainumbi/followers","following_url":"https://api.github.com/users/guainumbi/following{/other_user}","gists_url":"https://api.github.com/users/guainumbi/gists{/gist_id}","starred_url":"https://api.github.com/users/guainumbi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guainumbi/subscriptions","organizations_url":"https://api.github.com/users/guainumbi/orgs","repos_url":"https://api.github.com/users/guainumbi/repos","events_url":"https://api.github.com/users/guainumbi/events{/privacy}","received_events_url":"https://api.github.com/users/guainumbi/received_events","type":"User","site_admin":false},"body":"we should still keep the if / else statements for each .update in case the update was not successful, so that the user does not get a success message even though the update didn't work properly. Otherwise this looks good to me!","created_at":"2018-07-17T08:27:06Z","updated_at":"2018-07-17T08:34:06Z","html_url":"https://github.com/rubymonsters/diversity_ticketing/pull/398#discussion_r202934126","pull_request_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/pulls/398","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/rubymonsters/diversity_ticketing/pulls/comments/202934126"},"html":{"href":"https://github.com/rubymonsters/diversity_ticketing/pull/398#discussion_r202934126"},"pull_request":{"href":"https://api.github.com/repos/rubymonsters/diversity_ticketing/pulls/398"}}},"pull_request":{"url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/pulls/398","id":200410015,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwNDEwMDE1","html_url":"https://github.com/rubymonsters/diversity_ticketing/pull/398","diff_url":"https://github.com/rubymonsters/diversity_ticketing/pull/398.diff","patch_url":"https://github.com/rubymonsters/diversity_ticketing/pull/398.patch","issue_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/issues/398","number":398,"state":"open","locked":false,"title":"Adds refactoring for the new-delete-account branch","user":{"login":"mauditecandela","id":8235980,"node_id":"MDQ6VXNlcjgyMzU5ODA=","avatar_url":"https://avatars0.githubusercontent.com/u/8235980?v=4","gravatar_id":"","url":"https://api.github.com/users/mauditecandela","html_url":"https://github.com/mauditecandela","followers_url":"https://api.github.com/users/mauditecandela/followers","following_url":"https://api.github.com/users/mauditecandela/following{/other_user}","gists_url":"https://api.github.com/users/mauditecandela/gists{/gist_id}","starred_url":"https://api.github.com/users/mauditecandela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mauditecandela/subscriptions","organizations_url":"https://api.github.com/users/mauditecandela/orgs","repos_url":"https://api.github.com/users/mauditecandela/repos","events_url":"https://api.github.com/users/mauditecandela/events{/privacy}","received_events_url":"https://api.github.com/users/mauditecandela/received_events","type":"User","site_admin":false},"body":"Refactoring proposal for new-delete-account branch","created_at":"2018-07-10T14:10:49Z","updated_at":"2018-07-17T08:34:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"553014e3aba65f4948e4ce63fff9c8a73fb71be0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/pulls/398/commits","review_comments_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/pulls/398/comments","review_comment_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/issues/398/comments","statuses_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/statuses/d42f34121f5f60b22e8a0a254dfe9c2e4a4c773e","head":{"label":"rubymonsters:new-delete-account-refactoring","ref":"new-delete-account-refactoring","sha":"d42f34121f5f60b22e8a0a254dfe9c2e4a4c773e","user":{"login":"rubymonsters","id":3332041,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMzIwNDE=","avatar_url":"https://avatars3.githubusercontent.com/u/3332041?v=4","gravatar_id":"","url":"https://api.github.com/users/rubymonsters","html_url":"https://github.com/rubymonsters","followers_url":"https://api.github.com/users/rubymonsters/followers","following_url":"https://api.github.com/users/rubymonsters/following{/other_user}","gists_url":"https://api.github.com/users/rubymonsters/gists{/gist_id}","starred_url":"https://api.github.com/users/rubymonsters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubymonsters/subscriptions","organizations_url":"https://api.github.com/users/rubymonsters/orgs","repos_url":"https://api.github.com/users/rubymonsters/repos","events_url":"https://api.github.com/users/rubymonsters/events{/privacy}","received_events_url":"https://api.github.com/users/rubymonsters/received_events","type":"Organization","site_admin":false},"repo":{"id":38634836,"node_id":"MDEwOlJlcG9zaXRvcnkzODYzNDgzNg==","name":"diversity_ticketing","full_name":"rubymonsters/diversity_ticketing","owner":{"login":"rubymonsters","id":3332041,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMzIwNDE=","avatar_url":"https://avatars3.githubusercontent.com/u/3332041?v=4","gravatar_id":"","url":"https://api.github.com/users/rubymonsters","html_url":"https://github.com/rubymonsters","followers_url":"https://api.github.com/users/rubymonsters/followers","following_url":"https://api.github.com/users/rubymonsters/following{/other_user}","gists_url":"https://api.github.com/users/rubymonsters/gists{/gist_id}","starred_url":"https://api.github.com/users/rubymonsters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubymonsters/subscriptions","organizations_url":"https://api.github.com/users/rubymonsters/orgs","repos_url":"https://api.github.com/users/rubymonsters/repos","events_url":"https://api.github.com/users/rubymonsters/events{/privacy}","received_events_url":"https://api.github.com/users/rubymonsters/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rubymonsters/diversity_ticketing","description":"An app to make diversifying conferences easier!","fork":false,"url":"https://api.github.com/repos/rubymonsters/diversity_ticketing","forks_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/forks","keys_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/teams","hooks_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/hooks","issue_events_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/issues/events{/number}","events_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/events","assignees_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/assignees{/user}","branches_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/branches{/branch}","tags_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/tags","blobs_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/git/refs{/sha}","trees_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/statuses/{sha}","languages_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/languages","stargazers_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/stargazers","contributors_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/contributors","subscribers_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/subscribers","subscription_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/subscription","commits_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/commits{/sha}","git_commits_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/git/commits{/sha}","comments_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/comments{/number}","issue_comment_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/issues/comments{/number}","contents_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/contents/{+path}","compare_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/merges","archive_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/downloads","issues_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/issues{/number}","pulls_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/pulls{/number}","milestones_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/milestones{/number}","notifications_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/labels{/name}","releases_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/releases{/id}","deployments_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/deployments","created_at":"2015-07-06T17:34:30Z","updated_at":"2018-07-09T09:34:37Z","pushed_at":"2018-07-17T08:05:55Z","git_url":"git://github.com/rubymonsters/diversity_ticketing.git","ssh_url":"git@github.com:rubymonsters/diversity_ticketing.git","clone_url":"https://github.com/rubymonsters/diversity_ticketing.git","svn_url":"https://github.com/rubymonsters/diversity_ticketing","homepage":"https://diversitytickets.org","size":3511,"stargazers_count":27,"watchers_count":27,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":31,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":9,"open_issues":31,"watchers":27,"default_branch":"master"}},"base":{"label":"rubymonsters:new-delete-account","ref":"new-delete-account","sha":"b3a7946dfda37055ea1ff010a0c93c01b9d387cd","user":{"login":"rubymonsters","id":3332041,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMzIwNDE=","avatar_url":"https://avatars3.githubusercontent.com/u/3332041?v=4","gravatar_id":"","url":"https://api.github.com/users/rubymonsters","html_url":"https://github.com/rubymonsters","followers_url":"https://api.github.com/users/rubymonsters/followers","following_url":"https://api.github.com/users/rubymonsters/following{/other_user}","gists_url":"https://api.github.com/users/rubymonsters/gists{/gist_id}","starred_url":"https://api.github.com/users/rubymonsters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubymonsters/subscriptions","organizations_url":"https://api.github.com/users/rubymonsters/orgs","repos_url":"https://api.github.com/users/rubymonsters/repos","events_url":"https://api.github.com/users/rubymonsters/events{/privacy}","received_events_url":"https://api.github.com/users/rubymonsters/received_events","type":"Organization","site_admin":false},"repo":{"id":38634836,"node_id":"MDEwOlJlcG9zaXRvcnkzODYzNDgzNg==","name":"diversity_ticketing","full_name":"rubymonsters/diversity_ticketing","owner":{"login":"rubymonsters","id":3332041,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMzIwNDE=","avatar_url":"https://avatars3.githubusercontent.com/u/3332041?v=4","gravatar_id":"","url":"https://api.github.com/users/rubymonsters","html_url":"https://github.com/rubymonsters","followers_url":"https://api.github.com/users/rubymonsters/followers","following_url":"https://api.github.com/users/rubymonsters/following{/other_user}","gists_url":"https://api.github.com/users/rubymonsters/gists{/gist_id}","starred_url":"https://api.github.com/users/rubymonsters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubymonsters/subscriptions","organizations_url":"https://api.github.com/users/rubymonsters/orgs","repos_url":"https://api.github.com/users/rubymonsters/repos","events_url":"https://api.github.com/users/rubymonsters/events{/privacy}","received_events_url":"https://api.github.com/users/rubymonsters/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rubymonsters/diversity_ticketing","description":"An app to make diversifying conferences easier!","fork":false,"url":"https://api.github.com/repos/rubymonsters/diversity_ticketing","forks_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/forks","keys_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/teams","hooks_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/hooks","issue_events_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/issues/events{/number}","events_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/events","assignees_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/assignees{/user}","branches_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/branches{/branch}","tags_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/tags","blobs_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/git/refs{/sha}","trees_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/statuses/{sha}","languages_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/languages","stargazers_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/stargazers","contributors_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/contributors","subscribers_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/subscribers","subscription_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/subscription","commits_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/commits{/sha}","git_commits_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/git/commits{/sha}","comments_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/comments{/number}","issue_comment_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/issues/comments{/number}","contents_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/contents/{+path}","compare_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/merges","archive_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/downloads","issues_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/issues{/number}","pulls_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/pulls{/number}","milestones_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/milestones{/number}","notifications_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/labels{/name}","releases_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/releases{/id}","deployments_url":"https://api.github.com/repos/rubymonsters/diversity_ticketing/deployments","created_at":"2015-07-06T17:34:30Z","updated_at":"2018-07-09T09:34:37Z","pushed_at":"2018-07-17T08:05:55Z","git_url":"git://github.com/rubymonsters/diversity_ticketing.git","ssh_url":"git@github.com:rubymonsters/diversity_ticketing.git","clone_url":"https://github.com/rubymonsters/diversity_ticketing.git","svn_url":"https://github.com/rubymonsters/diversity_ticketing","homepage":"https://diversitytickets.org","size":3511,"stargazers_count":27,"watchers_count":27,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":31,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":9,"open_issues":31,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rubymonsters/diversity_ticketing/pulls/398"},"html":{"href":"https://github.com/rubymonsters/diversity_ticketing/pull/398"},"issue":{"href":"https://api.github.com/repos/rubymonsters/diversity_ticketing/issues/398"},"comments":{"href":"https://api.github.com/repos/rubymonsters/diversity_ticketing/issues/398/comments"},"review_comments":{"href":"https://api.github.com/repos/rubymonsters/diversity_ticketing/pulls/398/comments"},"review_comment":{"href":"https://api.github.com/repos/rubymonsters/diversity_ticketing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rubymonsters/diversity_ticketing/pulls/398/commits"},"statuses":{"href":"https://api.github.com/repos/rubymonsters/diversity_ticketing/statuses/d42f34121f5f60b22e8a0a254dfe9c2e4a4c773e"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"guainumbi"}}