{"action":"created","comment":{"url":"https://api.github.com/repos/ric-reyes/Wall-B/pulls/comments/24377422","id":24377422,"diff_hunk":"@@ -145,9 +159,15 @@ class Message\n \n # POST *like* data from show_wall\n post('/messages/:message_id/like') do\n-  message = Message.get(params[:message_id])\n-  likes = message.likes + 1\n-  message.update(:likes => likes)\n+  user = request.ip\n+  message_id = params[:message_id]\n+  message = Message.get(message_id)\n+\n+  existing_likers = Like.find_likers(message_id)\n+\n+  unless existing_likers.include?(user)","path":"wall_b.rb","position":91,"original_position":91,"commit_id":"9da9e922a0f8a8c481b60517b92c95f0af43415a","original_commit_id":"9da9e922a0f8a8c481b60517b92c95f0af43415a","user":{"login":"openspectrum","id":709100,"avatar_url":"https://avatars.githubusercontent.com/u/709100?v=3","gravatar_id":"","url":"https://api.github.com/users/openspectrum","html_url":"https://github.com/openspectrum","followers_url":"https://api.github.com/users/openspectrum/followers","following_url":"https://api.github.com/users/openspectrum/following{/other_user}","gists_url":"https://api.github.com/users/openspectrum/gists{/gist_id}","starred_url":"https://api.github.com/users/openspectrum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openspectrum/subscriptions","organizations_url":"https://api.github.com/users/openspectrum/orgs","repos_url":"https://api.github.com/users/openspectrum/repos","events_url":"https://api.github.com/users/openspectrum/events{/privacy}","received_events_url":"https://api.github.com/users/openspectrum/received_events","type":"User","site_admin":false},"body":"Nice work on the logic of using IP addresses to link users to likes!\r\n\r\nSee my comment above on how to make this code a bit more clear: https://github.com/ric-reyes/Wall-B/pull/4/files#r24377306","created_at":"2015-02-09T23:46:40Z","updated_at":"2015-02-09T23:46:40Z","html_url":"https://github.com/ric-reyes/Wall-B/pull/4#discussion_r24377422","pull_request_url":"https://api.github.com/repos/ric-reyes/Wall-B/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/ric-reyes/Wall-B/pulls/comments/24377422"},"html":{"href":"https://github.com/ric-reyes/Wall-B/pull/4#discussion_r24377422"},"pull_request":{"href":"https://api.github.com/repos/ric-reyes/Wall-B/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/ric-reyes/Wall-B/pulls/4","id":28895256,"html_url":"https://github.com/ric-reyes/Wall-B/pull/4","diff_url":"https://github.com/ric-reyes/Wall-B/pull/4.diff","patch_url":"https://github.com/ric-reyes/Wall-B/pull/4.patch","issue_url":"https://api.github.com/repos/ric-reyes/Wall-B/issues/4","number":4,"state":"closed","locked":false,"title":"Wall dev","user":{"login":"ric-reyes","id":10178481,"avatar_url":"https://avatars.githubusercontent.com/u/10178481?v=3","gravatar_id":"","url":"https://api.github.com/users/ric-reyes","html_url":"https://github.com/ric-reyes","followers_url":"https://api.github.com/users/ric-reyes/followers","following_url":"https://api.github.com/users/ric-reyes/following{/other_user}","gists_url":"https://api.github.com/users/ric-reyes/gists{/gist_id}","starred_url":"https://api.github.com/users/ric-reyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ric-reyes/subscriptions","organizations_url":"https://api.github.com/users/ric-reyes/orgs","repos_url":"https://api.github.com/users/ric-reyes/repos","events_url":"https://api.github.com/users/ric-reyes/events{/privacy}","received_events_url":"https://api.github.com/users/ric-reyes/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-09T04:01:40Z","updated_at":"2015-02-09T23:46:40Z","closed_at":"2015-02-09T04:02:35Z","merged_at":"2015-02-09T04:02:35Z","merge_commit_sha":"3c66d85bd8b2db52d866da3fb9a5d328cb82540f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ric-reyes/Wall-B/pulls/4/commits","review_comments_url":"https://api.github.com/repos/ric-reyes/Wall-B/pulls/4/comments","review_comment_url":"https://api.github.com/repos/ric-reyes/Wall-B/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ric-reyes/Wall-B/issues/4/comments","statuses_url":"https://api.github.com/repos/ric-reyes/Wall-B/statuses/9da9e922a0f8a8c481b60517b92c95f0af43415a","head":{"label":"ric-reyes:wall-dev","ref":"wall-dev","sha":"9da9e922a0f8a8c481b60517b92c95f0af43415a","user":{"login":"ric-reyes","id":10178481,"avatar_url":"https://avatars.githubusercontent.com/u/10178481?v=3","gravatar_id":"","url":"https://api.github.com/users/ric-reyes","html_url":"https://github.com/ric-reyes","followers_url":"https://api.github.com/users/ric-reyes/followers","following_url":"https://api.github.com/users/ric-reyes/following{/other_user}","gists_url":"https://api.github.com/users/ric-reyes/gists{/gist_id}","starred_url":"https://api.github.com/users/ric-reyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ric-reyes/subscriptions","organizations_url":"https://api.github.com/users/ric-reyes/orgs","repos_url":"https://api.github.com/users/ric-reyes/repos","events_url":"https://api.github.com/users/ric-reyes/events{/privacy}","received_events_url":"https://api.github.com/users/ric-reyes/received_events","type":"User","site_admin":false},"repo":{"id":30399690,"name":"Wall-B","full_name":"ric-reyes/Wall-B","owner":{"login":"ric-reyes","id":10178481,"avatar_url":"https://avatars.githubusercontent.com/u/10178481?v=3","gravatar_id":"","url":"https://api.github.com/users/ric-reyes","html_url":"https://github.com/ric-reyes","followers_url":"https://api.github.com/users/ric-reyes/followers","following_url":"https://api.github.com/users/ric-reyes/following{/other_user}","gists_url":"https://api.github.com/users/ric-reyes/gists{/gist_id}","starred_url":"https://api.github.com/users/ric-reyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ric-reyes/subscriptions","organizations_url":"https://api.github.com/users/ric-reyes/orgs","repos_url":"https://api.github.com/users/ric-reyes/repos","events_url":"https://api.github.com/users/ric-reyes/events{/privacy}","received_events_url":"https://api.github.com/users/ric-reyes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ric-reyes/Wall-B","description":"Wall/Message challenge - Web Fundamentals","fork":true,"url":"https://api.github.com/repos/ric-reyes/Wall-B","forks_url":"https://api.github.com/repos/ric-reyes/Wall-B/forks","keys_url":"https://api.github.com/repos/ric-reyes/Wall-B/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ric-reyes/Wall-B/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ric-reyes/Wall-B/teams","hooks_url":"https://api.github.com/repos/ric-reyes/Wall-B/hooks","issue_events_url":"https://api.github.com/repos/ric-reyes/Wall-B/issues/events{/number}","events_url":"https://api.github.com/repos/ric-reyes/Wall-B/events","assignees_url":"https://api.github.com/repos/ric-reyes/Wall-B/assignees{/user}","branches_url":"https://api.github.com/repos/ric-reyes/Wall-B/branches{/branch}","tags_url":"https://api.github.com/repos/ric-reyes/Wall-B/tags","blobs_url":"https://api.github.com/repos/ric-reyes/Wall-B/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ric-reyes/Wall-B/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ric-reyes/Wall-B/git/refs{/sha}","trees_url":"https://api.github.com/repos/ric-reyes/Wall-B/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ric-reyes/Wall-B/statuses/{sha}","languages_url":"https://api.github.com/repos/ric-reyes/Wall-B/languages","stargazers_url":"https://api.github.com/repos/ric-reyes/Wall-B/stargazers","contributors_url":"https://api.github.com/repos/ric-reyes/Wall-B/contributors","subscribers_url":"https://api.github.com/repos/ric-reyes/Wall-B/subscribers","subscription_url":"https://api.github.com/repos/ric-reyes/Wall-B/subscription","commits_url":"https://api.github.com/repos/ric-reyes/Wall-B/commits{/sha}","git_commits_url":"https://api.github.com/repos/ric-reyes/Wall-B/git/commits{/sha}","comments_url":"https://api.github.com/repos/ric-reyes/Wall-B/comments{/number}","issue_comment_url":"https://api.github.com/repos/ric-reyes/Wall-B/issues/comments/{number}","contents_url":"https://api.github.com/repos/ric-reyes/Wall-B/contents/{+path}","compare_url":"https://api.github.com/repos/ric-reyes/Wall-B/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ric-reyes/Wall-B/merges","archive_url":"https://api.github.com/repos/ric-reyes/Wall-B/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ric-reyes/Wall-B/downloads","issues_url":"https://api.github.com/repos/ric-reyes/Wall-B/issues{/number}","pulls_url":"https://api.github.com/repos/ric-reyes/Wall-B/pulls{/number}","milestones_url":"https://api.github.com/repos/ric-reyes/Wall-B/milestones{/number}","notifications_url":"https://api.github.com/repos/ric-reyes/Wall-B/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ric-reyes/Wall-B/labels{/name}","releases_url":"https://api.github.com/repos/ric-reyes/Wall-B/releases{/id}","created_at":"2015-02-06T06:58:40Z","updated_at":"2015-02-09T04:02:35Z","pushed_at":"2015-02-09T04:02:35Z","git_url":"git://github.com/ric-reyes/Wall-B.git","ssh_url":"git@github.com:ric-reyes/Wall-B.git","clone_url":"https://github.com/ric-reyes/Wall-B.git","svn_url":"https://github.com/ric-reyes/Wall-B","homepage":"","size":202,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ric-reyes:master","ref":"master","sha":"ac181ce27981e167c30eb83c5611559c85bddce8","user":{"login":"ric-reyes","id":10178481,"avatar_url":"https://avatars.githubusercontent.com/u/10178481?v=3","gravatar_id":"","url":"https://api.github.com/users/ric-reyes","html_url":"https://github.com/ric-reyes","followers_url":"https://api.github.com/users/ric-reyes/followers","following_url":"https://api.github.com/users/ric-reyes/following{/other_user}","gists_url":"https://api.github.com/users/ric-reyes/gists{/gist_id}","starred_url":"https://api.github.com/users/ric-reyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ric-reyes/subscriptions","organizations_url":"https://api.github.com/users/ric-reyes/orgs","repos_url":"https://api.github.com/users/ric-reyes/repos","events_url":"https://api.github.com/users/ric-reyes/events{/privacy}","received_events_url":"https://api.github.com/users/ric-reyes/received_events","type":"User","site_admin":false},"repo":{"id":30399690,"name":"Wall-B","full_name":"ric-reyes/Wall-B","owner":{"login":"ric-reyes","id":10178481,"avatar_url":"https://avatars.githubusercontent.com/u/10178481?v=3","gravatar_id":"","url":"https://api.github.com/users/ric-reyes","html_url":"https://github.com/ric-reyes","followers_url":"https://api.github.com/users/ric-reyes/followers","following_url":"https://api.github.com/users/ric-reyes/following{/other_user}","gists_url":"https://api.github.com/users/ric-reyes/gists{/gist_id}","starred_url":"https://api.github.com/users/ric-reyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ric-reyes/subscriptions","organizations_url":"https://api.github.com/users/ric-reyes/orgs","repos_url":"https://api.github.com/users/ric-reyes/repos","events_url":"https://api.github.com/users/ric-reyes/events{/privacy}","received_events_url":"https://api.github.com/users/ric-reyes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ric-reyes/Wall-B","description":"Wall/Message challenge - Web Fundamentals","fork":true,"url":"https://api.github.com/repos/ric-reyes/Wall-B","forks_url":"https://api.github.com/repos/ric-reyes/Wall-B/forks","keys_url":"https://api.github.com/repos/ric-reyes/Wall-B/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ric-reyes/Wall-B/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ric-reyes/Wall-B/teams","hooks_url":"https://api.github.com/repos/ric-reyes/Wall-B/hooks","issue_events_url":"https://api.github.com/repos/ric-reyes/Wall-B/issues/events{/number}","events_url":"https://api.github.com/repos/ric-reyes/Wall-B/events","assignees_url":"https://api.github.com/repos/ric-reyes/Wall-B/assignees{/user}","branches_url":"https://api.github.com/repos/ric-reyes/Wall-B/branches{/branch}","tags_url":"https://api.github.com/repos/ric-reyes/Wall-B/tags","blobs_url":"https://api.github.com/repos/ric-reyes/Wall-B/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ric-reyes/Wall-B/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ric-reyes/Wall-B/git/refs{/sha}","trees_url":"https://api.github.com/repos/ric-reyes/Wall-B/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ric-reyes/Wall-B/statuses/{sha}","languages_url":"https://api.github.com/repos/ric-reyes/Wall-B/languages","stargazers_url":"https://api.github.com/repos/ric-reyes/Wall-B/stargazers","contributors_url":"https://api.github.com/repos/ric-reyes/Wall-B/contributors","subscribers_url":"https://api.github.com/repos/ric-reyes/Wall-B/subscribers","subscription_url":"https://api.github.com/repos/ric-reyes/Wall-B/subscription","commits_url":"https://api.github.com/repos/ric-reyes/Wall-B/commits{/sha}","git_commits_url":"https://api.github.com/repos/ric-reyes/Wall-B/git/commits{/sha}","comments_url":"https://api.github.com/repos/ric-reyes/Wall-B/comments{/number}","issue_comment_url":"https://api.github.com/repos/ric-reyes/Wall-B/issues/comments/{number}","contents_url":"https://api.github.com/repos/ric-reyes/Wall-B/contents/{+path}","compare_url":"https://api.github.com/repos/ric-reyes/Wall-B/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ric-reyes/Wall-B/merges","archive_url":"https://api.github.com/repos/ric-reyes/Wall-B/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ric-reyes/Wall-B/downloads","issues_url":"https://api.github.com/repos/ric-reyes/Wall-B/issues{/number}","pulls_url":"https://api.github.com/repos/ric-reyes/Wall-B/pulls{/number}","milestones_url":"https://api.github.com/repos/ric-reyes/Wall-B/milestones{/number}","notifications_url":"https://api.github.com/repos/ric-reyes/Wall-B/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ric-reyes/Wall-B/labels{/name}","releases_url":"https://api.github.com/repos/ric-reyes/Wall-B/releases{/id}","created_at":"2015-02-06T06:58:40Z","updated_at":"2015-02-09T04:02:35Z","pushed_at":"2015-02-09T04:02:35Z","git_url":"git://github.com/ric-reyes/Wall-B.git","ssh_url":"git@github.com:ric-reyes/Wall-B.git","clone_url":"https://github.com/ric-reyes/Wall-B.git","svn_url":"https://github.com/ric-reyes/Wall-B","homepage":"","size":202,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ric-reyes/Wall-B/pulls/4"},"html":{"href":"https://github.com/ric-reyes/Wall-B/pull/4"},"issue":{"href":"https://api.github.com/repos/ric-reyes/Wall-B/issues/4"},"comments":{"href":"https://api.github.com/repos/ric-reyes/Wall-B/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/ric-reyes/Wall-B/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/ric-reyes/Wall-B/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ric-reyes/Wall-B/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/ric-reyes/Wall-B/statuses/9da9e922a0f8a8c481b60517b92c95f0af43415a"}}}}