{"action":"created","comment":{"url":"https://api.github.com/repos/gduck/fritter/pulls/comments/24153013","id":24153013,"diff_hunk":"@@ -5,7 +5,9 @@ def index\n       permitted_params = params.permit(:category_id)\n       @pins = Pin.includes(:category).where(permitted_params).where(\"title LIKE '%#{params[:keyword]}%'\").order('created_at DESC').limit(params[:limit]).offset(params[:offset])\n     else\n-      @pins = Pin.includes(:category).all.order('created_at DESC').limit(params[:limit]).offset(params[:offset])\n+      # lets get an interesting selection for our front page\n+      grabSomePins = Pin.includes(:category).all.order('RANDOM()').limit(50)\n+      @pins = grabSomePins.order('created_at DESC').limit(params[:limit]).offset(params[:offset])","path":"app/controllers/pins_controller.rb","position":7,"original_position":7,"commit_id":"542dc1279bb2b99cb414f8c2aa910492a42f6a90","original_commit_id":"542dc1279bb2b99cb414f8c2aa910492a42f6a90","user":{"login":"harrychenca","id":1697380,"avatar_url":"https://avatars.githubusercontent.com/u/1697380?v=3","gravatar_id":"","url":"https://api.github.com/users/harrychenca","html_url":"https://github.com/harrychenca","followers_url":"https://api.github.com/users/harrychenca/followers","following_url":"https://api.github.com/users/harrychenca/following{/other_user}","gists_url":"https://api.github.com/users/harrychenca/gists{/gist_id}","starred_url":"https://api.github.com/users/harrychenca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harrychenca/subscriptions","organizations_url":"https://api.github.com/users/harrychenca/orgs","repos_url":"https://api.github.com/users/harrychenca/repos","events_url":"https://api.github.com/users/harrychenca/events{/privacy}","received_events_url":"https://api.github.com/users/harrychenca/received_events","type":"User","site_admin":false},"body":"How come `@pins` is defined twice? It's being overwritten.","created_at":"2015-02-05T09:57:05Z","updated_at":"2015-02-05T09:57:05Z","html_url":"https://github.com/gduck/fritter/pull/84#discussion_r24153013","pull_request_url":"https://api.github.com/repos/gduck/fritter/pulls/84","_links":{"self":{"href":"https://api.github.com/repos/gduck/fritter/pulls/comments/24153013"},"html":{"href":"https://github.com/gduck/fritter/pull/84#discussion_r24153013"},"pull_request":{"href":"https://api.github.com/repos/gduck/fritter/pulls/84"}}},"pull_request":{"url":"https://api.github.com/repos/gduck/fritter/pulls/84","id":28709350,"html_url":"https://github.com/gduck/fritter/pull/84","diff_url":"https://github.com/gduck/fritter/pull/84.diff","patch_url":"https://github.com/gduck/fritter/pull/84.patch","issue_url":"https://api.github.com/repos/gduck/fritter/issues/84","number":84,"state":"open","locked":false,"title":"Unlike pin","user":{"login":"gduck","id":9581715,"avatar_url":"https://avatars.githubusercontent.com/u/9581715?v=3","gravatar_id":"","url":"https://api.github.com/users/gduck","html_url":"https://github.com/gduck","followers_url":"https://api.github.com/users/gduck/followers","following_url":"https://api.github.com/users/gduck/following{/other_user}","gists_url":"https://api.github.com/users/gduck/gists{/gist_id}","starred_url":"https://api.github.com/users/gduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gduck/subscriptions","organizations_url":"https://api.github.com/users/gduck/orgs","repos_url":"https://api.github.com/users/gduck/repos","events_url":"https://api.github.com/users/gduck/events{/privacy}","received_events_url":"https://api.github.com/users/gduck/received_events","type":"User","site_admin":false},"body":"on user page you can unlike a currently like pin\r\n\r\nIt sends a request to delete the pin_id from likes, rails controller looks that up by current_user & pin_id, deletes. The view removes that pin from the current array of $scope.pins\r\n","created_at":"2015-02-05T09:23:29Z","updated_at":"2015-02-05T09:57:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8d8439e592b183556524f8ca37e27883a728ba19","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gduck/fritter/pulls/84/commits","review_comments_url":"https://api.github.com/repos/gduck/fritter/pulls/84/comments","review_comment_url":"https://api.github.com/repos/gduck/fritter/pulls/comments/{number}","comments_url":"https://api.github.com/repos/gduck/fritter/issues/84/comments","statuses_url":"https://api.github.com/repos/gduck/fritter/statuses/542dc1279bb2b99cb414f8c2aa910492a42f6a90","head":{"label":"gduck:unlike-pin","ref":"unlike-pin","sha":"542dc1279bb2b99cb414f8c2aa910492a42f6a90","user":{"login":"gduck","id":9581715,"avatar_url":"https://avatars.githubusercontent.com/u/9581715?v=3","gravatar_id":"","url":"https://api.github.com/users/gduck","html_url":"https://github.com/gduck","followers_url":"https://api.github.com/users/gduck/followers","following_url":"https://api.github.com/users/gduck/following{/other_user}","gists_url":"https://api.github.com/users/gduck/gists{/gist_id}","starred_url":"https://api.github.com/users/gduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gduck/subscriptions","organizations_url":"https://api.github.com/users/gduck/orgs","repos_url":"https://api.github.com/users/gduck/repos","events_url":"https://api.github.com/users/gduck/events{/privacy}","received_events_url":"https://api.github.com/users/gduck/received_events","type":"User","site_admin":false},"repo":{"id":29386329,"name":"fritter","full_name":"gduck/fritter","owner":{"login":"gduck","id":9581715,"avatar_url":"https://avatars.githubusercontent.com/u/9581715?v=3","gravatar_id":"","url":"https://api.github.com/users/gduck","html_url":"https://github.com/gduck","followers_url":"https://api.github.com/users/gduck/followers","following_url":"https://api.github.com/users/gduck/following{/other_user}","gists_url":"https://api.github.com/users/gduck/gists{/gist_id}","starred_url":"https://api.github.com/users/gduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gduck/subscriptions","organizations_url":"https://api.github.com/users/gduck/orgs","repos_url":"https://api.github.com/users/gduck/repos","events_url":"https://api.github.com/users/gduck/events{/privacy}","received_events_url":"https://api.github.com/users/gduck/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gduck/fritter","description":"pinterest style masonry layout ","fork":false,"url":"https://api.github.com/repos/gduck/fritter","forks_url":"https://api.github.com/repos/gduck/fritter/forks","keys_url":"https://api.github.com/repos/gduck/fritter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gduck/fritter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gduck/fritter/teams","hooks_url":"https://api.github.com/repos/gduck/fritter/hooks","issue_events_url":"https://api.github.com/repos/gduck/fritter/issues/events{/number}","events_url":"https://api.github.com/repos/gduck/fritter/events","assignees_url":"https://api.github.com/repos/gduck/fritter/assignees{/user}","branches_url":"https://api.github.com/repos/gduck/fritter/branches{/branch}","tags_url":"https://api.github.com/repos/gduck/fritter/tags","blobs_url":"https://api.github.com/repos/gduck/fritter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gduck/fritter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gduck/fritter/git/refs{/sha}","trees_url":"https://api.github.com/repos/gduck/fritter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gduck/fritter/statuses/{sha}","languages_url":"https://api.github.com/repos/gduck/fritter/languages","stargazers_url":"https://api.github.com/repos/gduck/fritter/stargazers","contributors_url":"https://api.github.com/repos/gduck/fritter/contributors","subscribers_url":"https://api.github.com/repos/gduck/fritter/subscribers","subscription_url":"https://api.github.com/repos/gduck/fritter/subscription","commits_url":"https://api.github.com/repos/gduck/fritter/commits{/sha}","git_commits_url":"https://api.github.com/repos/gduck/fritter/git/commits{/sha}","comments_url":"https://api.github.com/repos/gduck/fritter/comments{/number}","issue_comment_url":"https://api.github.com/repos/gduck/fritter/issues/comments/{number}","contents_url":"https://api.github.com/repos/gduck/fritter/contents/{+path}","compare_url":"https://api.github.com/repos/gduck/fritter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gduck/fritter/merges","archive_url":"https://api.github.com/repos/gduck/fritter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gduck/fritter/downloads","issues_url":"https://api.github.com/repos/gduck/fritter/issues{/number}","pulls_url":"https://api.github.com/repos/gduck/fritter/pulls{/number}","milestones_url":"https://api.github.com/repos/gduck/fritter/milestones{/number}","notifications_url":"https://api.github.com/repos/gduck/fritter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gduck/fritter/labels{/name}","releases_url":"https://api.github.com/repos/gduck/fritter/releases{/id}","created_at":"2015-01-17T09:24:26Z","updated_at":"2015-02-05T07:43:57Z","pushed_at":"2015-02-05T09:48:44Z","git_url":"git://github.com/gduck/fritter.git","ssh_url":"git@github.com:gduck/fritter.git","clone_url":"https://github.com/gduck/fritter.git","svn_url":"https://github.com/gduck/fritter","homepage":null,"size":2024,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":1,"default_branch":"master"}},"base":{"label":"gduck:master","ref":"master","sha":"0fbc59963915c762da5acbe846d6ed29b1d77f49","user":{"login":"gduck","id":9581715,"avatar_url":"https://avatars.githubusercontent.com/u/9581715?v=3","gravatar_id":"","url":"https://api.github.com/users/gduck","html_url":"https://github.com/gduck","followers_url":"https://api.github.com/users/gduck/followers","following_url":"https://api.github.com/users/gduck/following{/other_user}","gists_url":"https://api.github.com/users/gduck/gists{/gist_id}","starred_url":"https://api.github.com/users/gduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gduck/subscriptions","organizations_url":"https://api.github.com/users/gduck/orgs","repos_url":"https://api.github.com/users/gduck/repos","events_url":"https://api.github.com/users/gduck/events{/privacy}","received_events_url":"https://api.github.com/users/gduck/received_events","type":"User","site_admin":false},"repo":{"id":29386329,"name":"fritter","full_name":"gduck/fritter","owner":{"login":"gduck","id":9581715,"avatar_url":"https://avatars.githubusercontent.com/u/9581715?v=3","gravatar_id":"","url":"https://api.github.com/users/gduck","html_url":"https://github.com/gduck","followers_url":"https://api.github.com/users/gduck/followers","following_url":"https://api.github.com/users/gduck/following{/other_user}","gists_url":"https://api.github.com/users/gduck/gists{/gist_id}","starred_url":"https://api.github.com/users/gduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gduck/subscriptions","organizations_url":"https://api.github.com/users/gduck/orgs","repos_url":"https://api.github.com/users/gduck/repos","events_url":"https://api.github.com/users/gduck/events{/privacy}","received_events_url":"https://api.github.com/users/gduck/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gduck/fritter","description":"pinterest style masonry layout ","fork":false,"url":"https://api.github.com/repos/gduck/fritter","forks_url":"https://api.github.com/repos/gduck/fritter/forks","keys_url":"https://api.github.com/repos/gduck/fritter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gduck/fritter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gduck/fritter/teams","hooks_url":"https://api.github.com/repos/gduck/fritter/hooks","issue_events_url":"https://api.github.com/repos/gduck/fritter/issues/events{/number}","events_url":"https://api.github.com/repos/gduck/fritter/events","assignees_url":"https://api.github.com/repos/gduck/fritter/assignees{/user}","branches_url":"https://api.github.com/repos/gduck/fritter/branches{/branch}","tags_url":"https://api.github.com/repos/gduck/fritter/tags","blobs_url":"https://api.github.com/repos/gduck/fritter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gduck/fritter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gduck/fritter/git/refs{/sha}","trees_url":"https://api.github.com/repos/gduck/fritter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gduck/fritter/statuses/{sha}","languages_url":"https://api.github.com/repos/gduck/fritter/languages","stargazers_url":"https://api.github.com/repos/gduck/fritter/stargazers","contributors_url":"https://api.github.com/repos/gduck/fritter/contributors","subscribers_url":"https://api.github.com/repos/gduck/fritter/subscribers","subscription_url":"https://api.github.com/repos/gduck/fritter/subscription","commits_url":"https://api.github.com/repos/gduck/fritter/commits{/sha}","git_commits_url":"https://api.github.com/repos/gduck/fritter/git/commits{/sha}","comments_url":"https://api.github.com/repos/gduck/fritter/comments{/number}","issue_comment_url":"https://api.github.com/repos/gduck/fritter/issues/comments/{number}","contents_url":"https://api.github.com/repos/gduck/fritter/contents/{+path}","compare_url":"https://api.github.com/repos/gduck/fritter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gduck/fritter/merges","archive_url":"https://api.github.com/repos/gduck/fritter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gduck/fritter/downloads","issues_url":"https://api.github.com/repos/gduck/fritter/issues{/number}","pulls_url":"https://api.github.com/repos/gduck/fritter/pulls{/number}","milestones_url":"https://api.github.com/repos/gduck/fritter/milestones{/number}","notifications_url":"https://api.github.com/repos/gduck/fritter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gduck/fritter/labels{/name}","releases_url":"https://api.github.com/repos/gduck/fritter/releases{/id}","created_at":"2015-01-17T09:24:26Z","updated_at":"2015-02-05T07:43:57Z","pushed_at":"2015-02-05T09:48:44Z","git_url":"git://github.com/gduck/fritter.git","ssh_url":"git@github.com:gduck/fritter.git","clone_url":"https://github.com/gduck/fritter.git","svn_url":"https://github.com/gduck/fritter","homepage":null,"size":2024,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gduck/fritter/pulls/84"},"html":{"href":"https://github.com/gduck/fritter/pull/84"},"issue":{"href":"https://api.github.com/repos/gduck/fritter/issues/84"},"comments":{"href":"https://api.github.com/repos/gduck/fritter/issues/84/comments"},"review_comments":{"href":"https://api.github.com/repos/gduck/fritter/pulls/84/comments"},"review_comment":{"href":"https://api.github.com/repos/gduck/fritter/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/gduck/fritter/pulls/84/commits"},"statuses":{"href":"https://api.github.com/repos/gduck/fritter/statuses/542dc1279bb2b99cb414f8c2aa910492a42f6a90"}}}}