{"action":"created","comment":{"url":"https://api.github.com/repos/catarse/catarse/pulls/comments/39160807","id":39160807,"diff_hunk":"@@ -0,0 +1,150 @@\n+class UpdateProjectsForHome < ActiveRecord::Migration\n+  def up\n+     execute <<-SQL\n+      DROP VIEW \"1\".projects_for_home;\n+\n+      CREATE OR REPLACE VIEW \"1\".projects_for_home AS \n+       WITH recommended_projects AS (\n+           SELECT 'recommended'::text AS origin,\n+              recommends.id AS project_id,\n+              recommends.name AS project_name,\n+              recommends.headline,\n+              recommends.permalink,\n+              recommends.state,\n+              recommends.created_at,\n+              recommends.remaining_time_json as remaining_time,\n+              recommends.expires_at,\n+              img_thumbnail(recommends.*,'large') AS project_img,\n+\n+              pt.pledged,\n+              pt.progress,\n+              s.acronym as state_acronym,\n+              u.name AS owner_name,\n+              c.name AS city_name\n+\n+             FROM (projects recommends\n+              JOIN users u ON (recommends.user_id = u.id)\n+              LEFT JOIN \"1\".project_totals pt ON (pt.project_id = recommends.id)\n+              LEFT JOIN cities c ON (c.id = recommends.city_id)","path":"db/migrate/20150908182326_update_projects_for_home.rb","position":28,"original_position":28,"commit_id":"b496543a6b8118b769030d90965a4fa77825d71c","original_commit_id":"b496543a6b8118b769030d90965a4fa77825d71c","user":{"login":"diogob","id":20662,"avatar_url":"https://avatars.githubusercontent.com/u/20662?v=3","gravatar_id":"","url":"https://api.github.com/users/diogob","html_url":"https://github.com/diogob","followers_url":"https://api.github.com/users/diogob/followers","following_url":"https://api.github.com/users/diogob/following{/other_user}","gists_url":"https://api.github.com/users/diogob/gists{/gist_id}","starred_url":"https://api.github.com/users/diogob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diogob/subscriptions","organizations_url":"https://api.github.com/users/diogob/orgs","repos_url":"https://api.github.com/users/diogob/repos","events_url":"https://api.github.com/users/diogob/events{/privacy}","received_events_url":"https://api.github.com/users/diogob/received_events","type":"User","site_admin":false},"body":"```public.cities``` and ```public.states```","created_at":"2015-09-10T13:43:47Z","updated_at":"2015-09-10T13:43:47Z","html_url":"https://github.com/catarse/catarse/pull/1742#discussion_r39160807","pull_request_url":"https://api.github.com/repos/catarse/catarse/pulls/1742","_links":{"self":{"href":"https://api.github.com/repos/catarse/catarse/pulls/comments/39160807"},"html":{"href":"https://github.com/catarse/catarse/pull/1742#discussion_r39160807"},"pull_request":{"href":"https://api.github.com/repos/catarse/catarse/pulls/1742"}}},"pull_request":{"url":"https://api.github.com/repos/catarse/catarse/pulls/1742","id":44466147,"html_url":"https://github.com/catarse/catarse/pull/1742","diff_url":"https://github.com/catarse/catarse/pull/1742.diff","patch_url":"https://github.com/catarse/catarse/pull/1742.patch","issue_url":"https://api.github.com/repos/catarse/catarse/issues/1742","number":1742,"state":"open","locked":false,"title":"Mithril home","user":{"login":"adrianob","id":2192093,"avatar_url":"https://avatars.githubusercontent.com/u/2192093?v=3","gravatar_id":"","url":"https://api.github.com/users/adrianob","html_url":"https://github.com/adrianob","followers_url":"https://api.github.com/users/adrianob/followers","following_url":"https://api.github.com/users/adrianob/following{/other_user}","gists_url":"https://api.github.com/users/adrianob/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianob/subscriptions","organizations_url":"https://api.github.com/users/adrianob/orgs","repos_url":"https://api.github.com/users/adrianob/repos","events_url":"https://api.github.com/users/adrianob/events{/privacy}","received_events_url":"https://api.github.com/users/adrianob/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-08T18:28:00Z","updated_at":"2015-09-10T13:43:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"afe1c826f285421958809f8037707adab10daa4e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/catarse/catarse/pulls/1742/commits","review_comments_url":"https://api.github.com/repos/catarse/catarse/pulls/1742/comments","review_comment_url":"https://api.github.com/repos/catarse/catarse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/catarse/catarse/issues/1742/comments","statuses_url":"https://api.github.com/repos/catarse/catarse/statuses/b496543a6b8118b769030d90965a4fa77825d71c","head":{"label":"adrianob:mithril_home","ref":"mithril_home","sha":"b496543a6b8118b769030d90965a4fa77825d71c","user":{"login":"adrianob","id":2192093,"avatar_url":"https://avatars.githubusercontent.com/u/2192093?v=3","gravatar_id":"","url":"https://api.github.com/users/adrianob","html_url":"https://github.com/adrianob","followers_url":"https://api.github.com/users/adrianob/followers","following_url":"https://api.github.com/users/adrianob/following{/other_user}","gists_url":"https://api.github.com/users/adrianob/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianob/subscriptions","organizations_url":"https://api.github.com/users/adrianob/orgs","repos_url":"https://api.github.com/users/adrianob/repos","events_url":"https://api.github.com/users/adrianob/events{/privacy}","received_events_url":"https://api.github.com/users/adrianob/received_events","type":"User","site_admin":false},"repo":{"id":12118817,"name":"catarse","full_name":"adrianob/catarse","owner":{"login":"adrianob","id":2192093,"avatar_url":"https://avatars.githubusercontent.com/u/2192093?v=3","gravatar_id":"","url":"https://api.github.com/users/adrianob","html_url":"https://github.com/adrianob","followers_url":"https://api.github.com/users/adrianob/followers","following_url":"https://api.github.com/users/adrianob/following{/other_user}","gists_url":"https://api.github.com/users/adrianob/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianob/subscriptions","organizations_url":"https://api.github.com/users/adrianob/orgs","repos_url":"https://api.github.com/users/adrianob/repos","events_url":"https://api.github.com/users/adrianob/events{/privacy}","received_events_url":"https://api.github.com/users/adrianob/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adrianob/catarse","description":"The first open source crowdfunding platform for creative projects in the world","fork":true,"url":"https://api.github.com/repos/adrianob/catarse","forks_url":"https://api.github.com/repos/adrianob/catarse/forks","keys_url":"https://api.github.com/repos/adrianob/catarse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adrianob/catarse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adrianob/catarse/teams","hooks_url":"https://api.github.com/repos/adrianob/catarse/hooks","issue_events_url":"https://api.github.com/repos/adrianob/catarse/issues/events{/number}","events_url":"https://api.github.com/repos/adrianob/catarse/events","assignees_url":"https://api.github.com/repos/adrianob/catarse/assignees{/user}","branches_url":"https://api.github.com/repos/adrianob/catarse/branches{/branch}","tags_url":"https://api.github.com/repos/adrianob/catarse/tags","blobs_url":"https://api.github.com/repos/adrianob/catarse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adrianob/catarse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adrianob/catarse/git/refs{/sha}","trees_url":"https://api.github.com/repos/adrianob/catarse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adrianob/catarse/statuses/{sha}","languages_url":"https://api.github.com/repos/adrianob/catarse/languages","stargazers_url":"https://api.github.com/repos/adrianob/catarse/stargazers","contributors_url":"https://api.github.com/repos/adrianob/catarse/contributors","subscribers_url":"https://api.github.com/repos/adrianob/catarse/subscribers","subscription_url":"https://api.github.com/repos/adrianob/catarse/subscription","commits_url":"https://api.github.com/repos/adrianob/catarse/commits{/sha}","git_commits_url":"https://api.github.com/repos/adrianob/catarse/git/commits{/sha}","comments_url":"https://api.github.com/repos/adrianob/catarse/comments{/number}","issue_comment_url":"https://api.github.com/repos/adrianob/catarse/issues/comments{/number}","contents_url":"https://api.github.com/repos/adrianob/catarse/contents/{+path}","compare_url":"https://api.github.com/repos/adrianob/catarse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adrianob/catarse/merges","archive_url":"https://api.github.com/repos/adrianob/catarse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adrianob/catarse/downloads","issues_url":"https://api.github.com/repos/adrianob/catarse/issues{/number}","pulls_url":"https://api.github.com/repos/adrianob/catarse/pulls{/number}","milestones_url":"https://api.github.com/repos/adrianob/catarse/milestones{/number}","notifications_url":"https://api.github.com/repos/adrianob/catarse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adrianob/catarse/labels{/name}","releases_url":"https://api.github.com/repos/adrianob/catarse/releases{/id}","created_at":"2013-08-14T20:31:53Z","updated_at":"2015-02-25T17:20:32Z","pushed_at":"2015-09-09T22:38:34Z","git_url":"git://github.com/adrianob/catarse.git","ssh_url":"git@github.com:adrianob/catarse.git","clone_url":"https://github.com/adrianob/catarse.git","svn_url":"https://github.com/adrianob/catarse","homepage":"http://catarse.me","size":58552,"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":"catarse:master","ref":"master","sha":"43bc5a335b5309ea9287398f7ce23f68dbaa31a0","user":{"login":"catarse","id":721161,"avatar_url":"https://avatars.githubusercontent.com/u/721161?v=3","gravatar_id":"","url":"https://api.github.com/users/catarse","html_url":"https://github.com/catarse","followers_url":"https://api.github.com/users/catarse/followers","following_url":"https://api.github.com/users/catarse/following{/other_user}","gists_url":"https://api.github.com/users/catarse/gists{/gist_id}","starred_url":"https://api.github.com/users/catarse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catarse/subscriptions","organizations_url":"https://api.github.com/users/catarse/orgs","repos_url":"https://api.github.com/users/catarse/repos","events_url":"https://api.github.com/users/catarse/events{/privacy}","received_events_url":"https://api.github.com/users/catarse/received_events","type":"Organization","site_admin":false},"repo":{"id":1071489,"name":"catarse","full_name":"catarse/catarse","owner":{"login":"catarse","id":721161,"avatar_url":"https://avatars.githubusercontent.com/u/721161?v=3","gravatar_id":"","url":"https://api.github.com/users/catarse","html_url":"https://github.com/catarse","followers_url":"https://api.github.com/users/catarse/followers","following_url":"https://api.github.com/users/catarse/following{/other_user}","gists_url":"https://api.github.com/users/catarse/gists{/gist_id}","starred_url":"https://api.github.com/users/catarse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catarse/subscriptions","organizations_url":"https://api.github.com/users/catarse/orgs","repos_url":"https://api.github.com/users/catarse/repos","events_url":"https://api.github.com/users/catarse/events{/privacy}","received_events_url":"https://api.github.com/users/catarse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/catarse/catarse","description":"The first open source crowdfunding platform for creative projects in the world","fork":false,"url":"https://api.github.com/repos/catarse/catarse","forks_url":"https://api.github.com/repos/catarse/catarse/forks","keys_url":"https://api.github.com/repos/catarse/catarse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/catarse/catarse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/catarse/catarse/teams","hooks_url":"https://api.github.com/repos/catarse/catarse/hooks","issue_events_url":"https://api.github.com/repos/catarse/catarse/issues/events{/number}","events_url":"https://api.github.com/repos/catarse/catarse/events","assignees_url":"https://api.github.com/repos/catarse/catarse/assignees{/user}","branches_url":"https://api.github.com/repos/catarse/catarse/branches{/branch}","tags_url":"https://api.github.com/repos/catarse/catarse/tags","blobs_url":"https://api.github.com/repos/catarse/catarse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/catarse/catarse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/catarse/catarse/git/refs{/sha}","trees_url":"https://api.github.com/repos/catarse/catarse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/catarse/catarse/statuses/{sha}","languages_url":"https://api.github.com/repos/catarse/catarse/languages","stargazers_url":"https://api.github.com/repos/catarse/catarse/stargazers","contributors_url":"https://api.github.com/repos/catarse/catarse/contributors","subscribers_url":"https://api.github.com/repos/catarse/catarse/subscribers","subscription_url":"https://api.github.com/repos/catarse/catarse/subscription","commits_url":"https://api.github.com/repos/catarse/catarse/commits{/sha}","git_commits_url":"https://api.github.com/repos/catarse/catarse/git/commits{/sha}","comments_url":"https://api.github.com/repos/catarse/catarse/comments{/number}","issue_comment_url":"https://api.github.com/repos/catarse/catarse/issues/comments{/number}","contents_url":"https://api.github.com/repos/catarse/catarse/contents/{+path}","compare_url":"https://api.github.com/repos/catarse/catarse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/catarse/catarse/merges","archive_url":"https://api.github.com/repos/catarse/catarse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/catarse/catarse/downloads","issues_url":"https://api.github.com/repos/catarse/catarse/issues{/number}","pulls_url":"https://api.github.com/repos/catarse/catarse/pulls{/number}","milestones_url":"https://api.github.com/repos/catarse/catarse/milestones{/number}","notifications_url":"https://api.github.com/repos/catarse/catarse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/catarse/catarse/labels{/name}","releases_url":"https://api.github.com/repos/catarse/catarse/releases{/id}","created_at":"2010-11-11T13:37:03Z","updated_at":"2015-09-09T00:10:16Z","pushed_at":"2015-09-09T22:39:17Z","git_url":"git://github.com/catarse/catarse.git","ssh_url":"git@github.com:catarse/catarse.git","clone_url":"https://github.com/catarse/catarse.git","svn_url":"https://github.com/catarse/catarse","homepage":"http://catarse.me","size":112928,"stargazers_count":881,"watchers_count":881,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":606,"mirror_url":null,"open_issues_count":12,"forks":606,"open_issues":12,"watchers":881,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/catarse/catarse/pulls/1742"},"html":{"href":"https://github.com/catarse/catarse/pull/1742"},"issue":{"href":"https://api.github.com/repos/catarse/catarse/issues/1742"},"comments":{"href":"https://api.github.com/repos/catarse/catarse/issues/1742/comments"},"review_comments":{"href":"https://api.github.com/repos/catarse/catarse/pulls/1742/comments"},"review_comment":{"href":"https://api.github.com/repos/catarse/catarse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/catarse/catarse/pulls/1742/commits"},"statuses":{"href":"https://api.github.com/repos/catarse/catarse/statuses/b496543a6b8118b769030d90965a4fa77825d71c"}}}}