{"action":"created","comment":{"url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/pulls/comments/87571582","pull_request_review_id":8179571,"id":87571582,"diff_hunk":"@@ -0,0 +1,5 @@\n+class RemoveCategoryIdFromChannels < ActiveRecord::Migration\n+  def change\n+    remove_column :channels, :category_id\n+  end\n+end","path":"db/migrate/20161109130035_remove_category_id_from_channels.rb","position":5,"original_position":5,"commit_id":"e076f5d9569ca75184f654a282ad92bd62cbe85c","original_commit_id":"19f661f4559ea4bd3bbb7eff6850e13ce8d36627","user":{"login":"matheuscla","id":12254845,"avatar_url":"https://avatars.githubusercontent.com/u/12254845?v=3","gravatar_id":"","url":"https://api.github.com/users/matheuscla","html_url":"https://github.com/matheuscla","followers_url":"https://api.github.com/users/matheuscla/followers","following_url":"https://api.github.com/users/matheuscla/following{/other_user}","gists_url":"https://api.github.com/users/matheuscla/gists{/gist_id}","starred_url":"https://api.github.com/users/matheuscla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matheuscla/subscriptions","organizations_url":"https://api.github.com/users/matheuscla/orgs","repos_url":"https://api.github.com/users/matheuscla/repos","events_url":"https://api.github.com/users/matheuscla/events{/privacy}","received_events_url":"https://api.github.com/users/matheuscla/received_events","type":"User","site_admin":false},"body":"Pensei em fazer uma migration que roda antes dessa que remove a coluna channel_id do channels. Essa migration pega o id do channel e o category_id e da um insert desses dados da tabela intermediaria categories_channels.","created_at":"2016-11-11T11:03:19Z","updated_at":"2016-11-11T11:03:19Z","html_url":"https://github.com/juntos-com-vc/juntos.com.vc/pull/246#discussion_r87571582","pull_request_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/pulls/246","_links":{"self":{"href":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/pulls/comments/87571582"},"html":{"href":"https://github.com/juntos-com-vc/juntos.com.vc/pull/246#discussion_r87571582"},"pull_request":{"href":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/pulls/246"}}},"pull_request":{"url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/pulls/246","id":92981921,"html_url":"https://github.com/juntos-com-vc/juntos.com.vc/pull/246","diff_url":"https://github.com/juntos-com-vc/juntos.com.vc/pull/246.diff","patch_url":"https://github.com/juntos-com-vc/juntos.com.vc/pull/246.patch","issue_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/issues/246","number":246,"state":"open","locked":false,"title":"Channel categories","user":{"login":"matheuscla","id":12254845,"avatar_url":"https://avatars.githubusercontent.com/u/12254845?v=3","gravatar_id":"","url":"https://api.github.com/users/matheuscla","html_url":"https://github.com/matheuscla","followers_url":"https://api.github.com/users/matheuscla/followers","following_url":"https://api.github.com/users/matheuscla/following{/other_user}","gists_url":"https://api.github.com/users/matheuscla/gists{/gist_id}","starred_url":"https://api.github.com/users/matheuscla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matheuscla/subscriptions","organizations_url":"https://api.github.com/users/matheuscla/orgs","repos_url":"https://api.github.com/users/matheuscla/repos","events_url":"https://api.github.com/users/matheuscla/events{/privacy}","received_events_url":"https://api.github.com/users/matheuscla/received_events","type":"User","site_admin":false},"body":"**Context:** Before a channel could had just one category, now a channel can have more than one. To do this I've created a has_and_belongs_to_many association in both models, I prefer create this kind of relation than create a has_many through. After this I created a migration to remove category_id from channels table and I created a new service called CreateMultiCategoriesChannel that recives two params, the first is an arrays with the categories_id and the second the channel.The service is responsible to insert an arrays of categories in the channel.categories\r\n","created_at":"2016-11-09T15:20:45Z","updated_at":"2016-11-11T11:03:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c96ab608069a42b0dead402b2471dfb36c97312d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/pulls/246/commits","review_comments_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/pulls/246/comments","review_comment_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/issues/246/comments","statuses_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/statuses/e076f5d9569ca75184f654a282ad92bd62cbe85c","head":{"label":"juntos-com-vc:channel-categories","ref":"channel-categories","sha":"e076f5d9569ca75184f654a282ad92bd62cbe85c","user":{"login":"juntos-com-vc","id":16776745,"avatar_url":"https://avatars.githubusercontent.com/u/16776745?v=3","gravatar_id":"","url":"https://api.github.com/users/juntos-com-vc","html_url":"https://github.com/juntos-com-vc","followers_url":"https://api.github.com/users/juntos-com-vc/followers","following_url":"https://api.github.com/users/juntos-com-vc/following{/other_user}","gists_url":"https://api.github.com/users/juntos-com-vc/gists{/gist_id}","starred_url":"https://api.github.com/users/juntos-com-vc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juntos-com-vc/subscriptions","organizations_url":"https://api.github.com/users/juntos-com-vc/orgs","repos_url":"https://api.github.com/users/juntos-com-vc/repos","events_url":"https://api.github.com/users/juntos-com-vc/events{/privacy}","received_events_url":"https://api.github.com/users/juntos-com-vc/received_events","type":"Organization","site_admin":false},"repo":{"id":25652386,"name":"juntos.com.vc","full_name":"juntos-com-vc/juntos.com.vc","owner":{"login":"juntos-com-vc","id":16776745,"avatar_url":"https://avatars.githubusercontent.com/u/16776745?v=3","gravatar_id":"","url":"https://api.github.com/users/juntos-com-vc","html_url":"https://github.com/juntos-com-vc","followers_url":"https://api.github.com/users/juntos-com-vc/followers","following_url":"https://api.github.com/users/juntos-com-vc/following{/other_user}","gists_url":"https://api.github.com/users/juntos-com-vc/gists{/gist_id}","starred_url":"https://api.github.com/users/juntos-com-vc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juntos-com-vc/subscriptions","organizations_url":"https://api.github.com/users/juntos-com-vc/orgs","repos_url":"https://api.github.com/users/juntos-com-vc/repos","events_url":"https://api.github.com/users/juntos-com-vc/events{/privacy}","received_events_url":"https://api.github.com/users/juntos-com-vc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/juntos-com-vc/juntos.com.vc","description":null,"fork":false,"url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc","forks_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/forks","keys_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/teams","hooks_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/hooks","issue_events_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/issues/events{/number}","events_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/events","assignees_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/assignees{/user}","branches_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/branches{/branch}","tags_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/tags","blobs_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/git/refs{/sha}","trees_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/statuses/{sha}","languages_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/languages","stargazers_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/stargazers","contributors_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/contributors","subscribers_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/subscribers","subscription_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/subscription","commits_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/commits{/sha}","git_commits_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/git/commits{/sha}","comments_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/comments{/number}","issue_comment_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/issues/comments{/number}","contents_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/contents/{+path}","compare_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/merges","archive_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/downloads","issues_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/issues{/number}","pulls_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/pulls{/number}","milestones_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/milestones{/number}","notifications_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/labels{/name}","releases_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/releases{/id}","deployments_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/deployments","created_at":"2014-10-23T18:43:07Z","updated_at":"2016-11-10T19:56:11Z","pushed_at":"2016-11-10T21:09:12Z","git_url":"git://github.com/juntos-com-vc/juntos.com.vc.git","ssh_url":"git@github.com:juntos-com-vc/juntos.com.vc.git","clone_url":"https://github.com/juntos-com-vc/juntos.com.vc.git","svn_url":"https://github.com/juntos-com-vc/juntos.com.vc","homepage":null,"size":50807,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":6,"forks":4,"open_issues":6,"watchers":6,"default_branch":"master"}},"base":{"label":"juntos-com-vc:master","ref":"master","sha":"3508ea58c31a8c6ec82c8f129187d47be0d38236","user":{"login":"juntos-com-vc","id":16776745,"avatar_url":"https://avatars.githubusercontent.com/u/16776745?v=3","gravatar_id":"","url":"https://api.github.com/users/juntos-com-vc","html_url":"https://github.com/juntos-com-vc","followers_url":"https://api.github.com/users/juntos-com-vc/followers","following_url":"https://api.github.com/users/juntos-com-vc/following{/other_user}","gists_url":"https://api.github.com/users/juntos-com-vc/gists{/gist_id}","starred_url":"https://api.github.com/users/juntos-com-vc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juntos-com-vc/subscriptions","organizations_url":"https://api.github.com/users/juntos-com-vc/orgs","repos_url":"https://api.github.com/users/juntos-com-vc/repos","events_url":"https://api.github.com/users/juntos-com-vc/events{/privacy}","received_events_url":"https://api.github.com/users/juntos-com-vc/received_events","type":"Organization","site_admin":false},"repo":{"id":25652386,"name":"juntos.com.vc","full_name":"juntos-com-vc/juntos.com.vc","owner":{"login":"juntos-com-vc","id":16776745,"avatar_url":"https://avatars.githubusercontent.com/u/16776745?v=3","gravatar_id":"","url":"https://api.github.com/users/juntos-com-vc","html_url":"https://github.com/juntos-com-vc","followers_url":"https://api.github.com/users/juntos-com-vc/followers","following_url":"https://api.github.com/users/juntos-com-vc/following{/other_user}","gists_url":"https://api.github.com/users/juntos-com-vc/gists{/gist_id}","starred_url":"https://api.github.com/users/juntos-com-vc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juntos-com-vc/subscriptions","organizations_url":"https://api.github.com/users/juntos-com-vc/orgs","repos_url":"https://api.github.com/users/juntos-com-vc/repos","events_url":"https://api.github.com/users/juntos-com-vc/events{/privacy}","received_events_url":"https://api.github.com/users/juntos-com-vc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/juntos-com-vc/juntos.com.vc","description":null,"fork":false,"url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc","forks_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/forks","keys_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/teams","hooks_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/hooks","issue_events_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/issues/events{/number}","events_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/events","assignees_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/assignees{/user}","branches_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/branches{/branch}","tags_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/tags","blobs_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/git/refs{/sha}","trees_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/statuses/{sha}","languages_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/languages","stargazers_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/stargazers","contributors_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/contributors","subscribers_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/subscribers","subscription_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/subscription","commits_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/commits{/sha}","git_commits_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/git/commits{/sha}","comments_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/comments{/number}","issue_comment_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/issues/comments{/number}","contents_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/contents/{+path}","compare_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/merges","archive_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/downloads","issues_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/issues{/number}","pulls_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/pulls{/number}","milestones_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/milestones{/number}","notifications_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/labels{/name}","releases_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/releases{/id}","deployments_url":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/deployments","created_at":"2014-10-23T18:43:07Z","updated_at":"2016-11-10T19:56:11Z","pushed_at":"2016-11-10T21:09:12Z","git_url":"git://github.com/juntos-com-vc/juntos.com.vc.git","ssh_url":"git@github.com:juntos-com-vc/juntos.com.vc.git","clone_url":"https://github.com/juntos-com-vc/juntos.com.vc.git","svn_url":"https://github.com/juntos-com-vc/juntos.com.vc","homepage":null,"size":50807,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":6,"forks":4,"open_issues":6,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/pulls/246"},"html":{"href":"https://github.com/juntos-com-vc/juntos.com.vc/pull/246"},"issue":{"href":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/issues/246"},"comments":{"href":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/issues/246/comments"},"review_comments":{"href":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/pulls/246/comments"},"review_comment":{"href":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/pulls/246/commits"},"statuses":{"href":"https://api.github.com/repos/juntos-com-vc/juntos.com.vc/statuses/e076f5d9569ca75184f654a282ad92bd62cbe85c"}}}}
{"actor":{"display_login":"matheuscla"}}