{"action":"created","comment":{"url":"https://api.github.com/repos/cbitstech/social_networking/pulls/comments/36997076","id":36997076,"diff_hunk":"@@ -43,25 +27,23 @@ def set_member_profiles\n     end\n \n     def set_current_profile\n-      id = params[:id] || current_participant.id\n-      @profile = Profile.find_or_create_by(\n-        participant_id: id, active: true) do |profile|\n-        begin\n-          SharedItem.create(\n-            item: profile,\n-            action_type: Profile::Actions.created)\n-        rescue ActiveRecord::StatementInvalid\n-          logger.info(\"Shared item already created for existing profile.\")\n-        end\n+      if params[:id]\n+        @profile = Profile.find(params[:id])\n+      else\n+        @profile = Profile\n+                   .find_or_initialize_by(\n+                     participant_id: current_participant.id)\n+        @profile.update_attributes(active: true)\n       end\n-      store_nudge_initiators(@profile.participant_id)\n     end\n \n     def store_nudge_initiators(participant_id)\n-      @notifications = Nudge.search(participant_id)\n-      @nudges = []\n-      @notifications.each do |notification|\n-        @nudges.push(notification.initiator.display_name)\n+      @nudging_display_names = []\n+      Nudge\n+        .search(participant_id)\n+        .each do |notification|\n+        @nudging_display_names.push(","path":"app/controllers/social_networking/profile_pages_controller.rb","position":59,"original_position":59,"commit_id":"2d1996020e8b38be1db67dbb4af758880f637629","original_commit_id":"2d1996020e8b38be1db67dbb4af758880f637629","user":{"login":"ericcf","id":58693,"avatar_url":"https://avatars.githubusercontent.com/u/58693?v=3","gravatar_id":"","url":"https://api.github.com/users/ericcf","html_url":"https://github.com/ericcf","followers_url":"https://api.github.com/users/ericcf/followers","following_url":"https://api.github.com/users/ericcf/following{/other_user}","gists_url":"https://api.github.com/users/ericcf/gists{/gist_id}","starred_url":"https://api.github.com/users/ericcf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericcf/subscriptions","organizations_url":"https://api.github.com/users/ericcf/orgs","repos_url":"https://api.github.com/users/ericcf/repos","events_url":"https://api.github.com/users/ericcf/events{/privacy}","received_events_url":"https://api.github.com/users/ericcf/received_events","type":"User","site_admin":false},"body":"Could you create this array with `.map` instead?","created_at":"2015-08-13T16:51:57Z","updated_at":"2015-08-13T16:51:57Z","html_url":"https://github.com/cbitstech/social_networking/pull/66#discussion_r36997076","pull_request_url":"https://api.github.com/repos/cbitstech/social_networking/pulls/66","_links":{"self":{"href":"https://api.github.com/repos/cbitstech/social_networking/pulls/comments/36997076"},"html":{"href":"https://github.com/cbitstech/social_networking/pull/66#discussion_r36997076"},"pull_request":{"href":"https://api.github.com/repos/cbitstech/social_networking/pulls/66"}}},"pull_request":{"url":"https://api.github.com/repos/cbitstech/social_networking/pulls/66","id":41922322,"html_url":"https://github.com/cbitstech/social_networking/pull/66","diff_url":"https://github.com/cbitstech/social_networking/pull/66.diff","patch_url":"https://github.com/cbitstech/social_networking/pull/66.patch","issue_url":"https://api.github.com/repos/cbitstech/social_networking/issues/66","number":66,"state":"open","locked":false,"title":"Fix Updating Profile Icon","user":{"login":"michaelwehrley","id":526136,"avatar_url":"https://avatars.githubusercontent.com/u/526136?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelwehrley","html_url":"https://github.com/michaelwehrley","followers_url":"https://api.github.com/users/michaelwehrley/followers","following_url":"https://api.github.com/users/michaelwehrley/following{/other_user}","gists_url":"https://api.github.com/users/michaelwehrley/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelwehrley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelwehrley/subscriptions","organizations_url":"https://api.github.com/users/michaelwehrley/orgs","repos_url":"https://api.github.com/users/michaelwehrley/repos","events_url":"https://api.github.com/users/michaelwehrley/events{/privacy}","received_events_url":"https://api.github.com/users/michaelwehrley/received_events","type":"User","site_admin":false},"body":"Fix Updating Profile Icon\r\n\r\n* Only allow one `profile` to exist for each participants.\r\n* Add alert for the user with errors if icon fails to update.\r\n* Update controller conditions when creating profile.\r\n* Find profile by calling profile on `current_participant`, not via params.\r\n\r\n[#100582464]","created_at":"2015-08-07T18:55:35Z","updated_at":"2015-08-13T16:51:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2839e5fd1c0ba7002e975affa5b3a495f6b1797e","assignee":{"login":"ericcf","id":58693,"avatar_url":"https://avatars.githubusercontent.com/u/58693?v=3","gravatar_id":"","url":"https://api.github.com/users/ericcf","html_url":"https://github.com/ericcf","followers_url":"https://api.github.com/users/ericcf/followers","following_url":"https://api.github.com/users/ericcf/following{/other_user}","gists_url":"https://api.github.com/users/ericcf/gists{/gist_id}","starred_url":"https://api.github.com/users/ericcf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericcf/subscriptions","organizations_url":"https://api.github.com/users/ericcf/orgs","repos_url":"https://api.github.com/users/ericcf/repos","events_url":"https://api.github.com/users/ericcf/events{/privacy}","received_events_url":"https://api.github.com/users/ericcf/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/cbitstech/social_networking/pulls/66/commits","review_comments_url":"https://api.github.com/repos/cbitstech/social_networking/pulls/66/comments","review_comment_url":"https://api.github.com/repos/cbitstech/social_networking/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cbitstech/social_networking/issues/66/comments","statuses_url":"https://api.github.com/repos/cbitstech/social_networking/statuses/2d1996020e8b38be1db67dbb4af758880f637629","head":{"label":"cbitstech:msw_100582464_fix_icon_updating","ref":"msw_100582464_fix_icon_updating","sha":"2d1996020e8b38be1db67dbb4af758880f637629","user":{"login":"cbitstech","id":864362,"avatar_url":"https://avatars.githubusercontent.com/u/864362?v=3","gravatar_id":"","url":"https://api.github.com/users/cbitstech","html_url":"https://github.com/cbitstech","followers_url":"https://api.github.com/users/cbitstech/followers","following_url":"https://api.github.com/users/cbitstech/following{/other_user}","gists_url":"https://api.github.com/users/cbitstech/gists{/gist_id}","starred_url":"https://api.github.com/users/cbitstech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbitstech/subscriptions","organizations_url":"https://api.github.com/users/cbitstech/orgs","repos_url":"https://api.github.com/users/cbitstech/repos","events_url":"https://api.github.com/users/cbitstech/events{/privacy}","received_events_url":"https://api.github.com/users/cbitstech/received_events","type":"User","site_admin":false},"repo":{"id":23404675,"name":"social_networking","full_name":"cbitstech/social_networking","owner":{"login":"cbitstech","id":864362,"avatar_url":"https://avatars.githubusercontent.com/u/864362?v=3","gravatar_id":"","url":"https://api.github.com/users/cbitstech","html_url":"https://github.com/cbitstech","followers_url":"https://api.github.com/users/cbitstech/followers","following_url":"https://api.github.com/users/cbitstech/following{/other_user}","gists_url":"https://api.github.com/users/cbitstech/gists{/gist_id}","starred_url":"https://api.github.com/users/cbitstech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbitstech/subscriptions","organizations_url":"https://api.github.com/users/cbitstech/orgs","repos_url":"https://api.github.com/users/cbitstech/repos","events_url":"https://api.github.com/users/cbitstech/events{/privacy}","received_events_url":"https://api.github.com/users/cbitstech/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cbitstech/social_networking","description":"","fork":false,"url":"https://api.github.com/repos/cbitstech/social_networking","forks_url":"https://api.github.com/repos/cbitstech/social_networking/forks","keys_url":"https://api.github.com/repos/cbitstech/social_networking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cbitstech/social_networking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cbitstech/social_networking/teams","hooks_url":"https://api.github.com/repos/cbitstech/social_networking/hooks","issue_events_url":"https://api.github.com/repos/cbitstech/social_networking/issues/events{/number}","events_url":"https://api.github.com/repos/cbitstech/social_networking/events","assignees_url":"https://api.github.com/repos/cbitstech/social_networking/assignees{/user}","branches_url":"https://api.github.com/repos/cbitstech/social_networking/branches{/branch}","tags_url":"https://api.github.com/repos/cbitstech/social_networking/tags","blobs_url":"https://api.github.com/repos/cbitstech/social_networking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cbitstech/social_networking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cbitstech/social_networking/git/refs{/sha}","trees_url":"https://api.github.com/repos/cbitstech/social_networking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cbitstech/social_networking/statuses/{sha}","languages_url":"https://api.github.com/repos/cbitstech/social_networking/languages","stargazers_url":"https://api.github.com/repos/cbitstech/social_networking/stargazers","contributors_url":"https://api.github.com/repos/cbitstech/social_networking/contributors","subscribers_url":"https://api.github.com/repos/cbitstech/social_networking/subscribers","subscription_url":"https://api.github.com/repos/cbitstech/social_networking/subscription","commits_url":"https://api.github.com/repos/cbitstech/social_networking/commits{/sha}","git_commits_url":"https://api.github.com/repos/cbitstech/social_networking/git/commits{/sha}","comments_url":"https://api.github.com/repos/cbitstech/social_networking/comments{/number}","issue_comment_url":"https://api.github.com/repos/cbitstech/social_networking/issues/comments{/number}","contents_url":"https://api.github.com/repos/cbitstech/social_networking/contents/{+path}","compare_url":"https://api.github.com/repos/cbitstech/social_networking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cbitstech/social_networking/merges","archive_url":"https://api.github.com/repos/cbitstech/social_networking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cbitstech/social_networking/downloads","issues_url":"https://api.github.com/repos/cbitstech/social_networking/issues{/number}","pulls_url":"https://api.github.com/repos/cbitstech/social_networking/pulls{/number}","milestones_url":"https://api.github.com/repos/cbitstech/social_networking/milestones{/number}","notifications_url":"https://api.github.com/repos/cbitstech/social_networking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cbitstech/social_networking/labels{/name}","releases_url":"https://api.github.com/repos/cbitstech/social_networking/releases{/id}","created_at":"2014-08-27T20:38:20Z","updated_at":"2015-07-07T19:27:40Z","pushed_at":"2015-08-13T16:29:29Z","git_url":"git://github.com/cbitstech/social_networking.git","ssh_url":"git@github.com:cbitstech/social_networking.git","clone_url":"https://github.com/cbitstech/social_networking.git","svn_url":"https://github.com/cbitstech/social_networking","homepage":null,"size":3396,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"cbitstech:master","ref":"master","sha":"1e8b5e89e92ed2747ada03b959eddcd4ef309811","user":{"login":"cbitstech","id":864362,"avatar_url":"https://avatars.githubusercontent.com/u/864362?v=3","gravatar_id":"","url":"https://api.github.com/users/cbitstech","html_url":"https://github.com/cbitstech","followers_url":"https://api.github.com/users/cbitstech/followers","following_url":"https://api.github.com/users/cbitstech/following{/other_user}","gists_url":"https://api.github.com/users/cbitstech/gists{/gist_id}","starred_url":"https://api.github.com/users/cbitstech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbitstech/subscriptions","organizations_url":"https://api.github.com/users/cbitstech/orgs","repos_url":"https://api.github.com/users/cbitstech/repos","events_url":"https://api.github.com/users/cbitstech/events{/privacy}","received_events_url":"https://api.github.com/users/cbitstech/received_events","type":"User","site_admin":false},"repo":{"id":23404675,"name":"social_networking","full_name":"cbitstech/social_networking","owner":{"login":"cbitstech","id":864362,"avatar_url":"https://avatars.githubusercontent.com/u/864362?v=3","gravatar_id":"","url":"https://api.github.com/users/cbitstech","html_url":"https://github.com/cbitstech","followers_url":"https://api.github.com/users/cbitstech/followers","following_url":"https://api.github.com/users/cbitstech/following{/other_user}","gists_url":"https://api.github.com/users/cbitstech/gists{/gist_id}","starred_url":"https://api.github.com/users/cbitstech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbitstech/subscriptions","organizations_url":"https://api.github.com/users/cbitstech/orgs","repos_url":"https://api.github.com/users/cbitstech/repos","events_url":"https://api.github.com/users/cbitstech/events{/privacy}","received_events_url":"https://api.github.com/users/cbitstech/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cbitstech/social_networking","description":"","fork":false,"url":"https://api.github.com/repos/cbitstech/social_networking","forks_url":"https://api.github.com/repos/cbitstech/social_networking/forks","keys_url":"https://api.github.com/repos/cbitstech/social_networking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cbitstech/social_networking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cbitstech/social_networking/teams","hooks_url":"https://api.github.com/repos/cbitstech/social_networking/hooks","issue_events_url":"https://api.github.com/repos/cbitstech/social_networking/issues/events{/number}","events_url":"https://api.github.com/repos/cbitstech/social_networking/events","assignees_url":"https://api.github.com/repos/cbitstech/social_networking/assignees{/user}","branches_url":"https://api.github.com/repos/cbitstech/social_networking/branches{/branch}","tags_url":"https://api.github.com/repos/cbitstech/social_networking/tags","blobs_url":"https://api.github.com/repos/cbitstech/social_networking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cbitstech/social_networking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cbitstech/social_networking/git/refs{/sha}","trees_url":"https://api.github.com/repos/cbitstech/social_networking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cbitstech/social_networking/statuses/{sha}","languages_url":"https://api.github.com/repos/cbitstech/social_networking/languages","stargazers_url":"https://api.github.com/repos/cbitstech/social_networking/stargazers","contributors_url":"https://api.github.com/repos/cbitstech/social_networking/contributors","subscribers_url":"https://api.github.com/repos/cbitstech/social_networking/subscribers","subscription_url":"https://api.github.com/repos/cbitstech/social_networking/subscription","commits_url":"https://api.github.com/repos/cbitstech/social_networking/commits{/sha}","git_commits_url":"https://api.github.com/repos/cbitstech/social_networking/git/commits{/sha}","comments_url":"https://api.github.com/repos/cbitstech/social_networking/comments{/number}","issue_comment_url":"https://api.github.com/repos/cbitstech/social_networking/issues/comments{/number}","contents_url":"https://api.github.com/repos/cbitstech/social_networking/contents/{+path}","compare_url":"https://api.github.com/repos/cbitstech/social_networking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cbitstech/social_networking/merges","archive_url":"https://api.github.com/repos/cbitstech/social_networking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cbitstech/social_networking/downloads","issues_url":"https://api.github.com/repos/cbitstech/social_networking/issues{/number}","pulls_url":"https://api.github.com/repos/cbitstech/social_networking/pulls{/number}","milestones_url":"https://api.github.com/repos/cbitstech/social_networking/milestones{/number}","notifications_url":"https://api.github.com/repos/cbitstech/social_networking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cbitstech/social_networking/labels{/name}","releases_url":"https://api.github.com/repos/cbitstech/social_networking/releases{/id}","created_at":"2014-08-27T20:38:20Z","updated_at":"2015-07-07T19:27:40Z","pushed_at":"2015-08-13T16:29:29Z","git_url":"git://github.com/cbitstech/social_networking.git","ssh_url":"git@github.com:cbitstech/social_networking.git","clone_url":"https://github.com/cbitstech/social_networking.git","svn_url":"https://github.com/cbitstech/social_networking","homepage":null,"size":3396,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cbitstech/social_networking/pulls/66"},"html":{"href":"https://github.com/cbitstech/social_networking/pull/66"},"issue":{"href":"https://api.github.com/repos/cbitstech/social_networking/issues/66"},"comments":{"href":"https://api.github.com/repos/cbitstech/social_networking/issues/66/comments"},"review_comments":{"href":"https://api.github.com/repos/cbitstech/social_networking/pulls/66/comments"},"review_comment":{"href":"https://api.github.com/repos/cbitstech/social_networking/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cbitstech/social_networking/pulls/66/commits"},"statuses":{"href":"https://api.github.com/repos/cbitstech/social_networking/statuses/2d1996020e8b38be1db67dbb4af758880f637629"}}}}