{"action":"created","comment":{"url":"https://api.github.com/repos/rails/rails/pulls/comments/59417212","id":59417212,"diff_hunk":"@@ -0,0 +1,13 @@\n+// Action Cable provides the framework to deal with WebSockets in Rails.\n+// You can generate new channels where WebSocket features live using the rails generate channel command.\n+//\n+//= require action_cable\n+//= require_self\n+//= require_tree ./channels\n+\n+(function() {\n+  this.App || (this.App = {});\n+\n+  App.cable = ActionCable.createConsumer();\n+\n+}).call(this);","path":"actioncable/lib/rails/generators/channel/templates/assets/cable.js","position":13,"original_position":13,"commit_id":"d0023deb74c8093900f0d703bb5c68eb766e5bdd","original_commit_id":"d0023deb74c8093900f0d703bb5c68eb766e5bdd","user":{"login":"prathamesh-sonpatki","id":621238,"avatar_url":"https://avatars.githubusercontent.com/u/621238?v=3","gravatar_id":"","url":"https://api.github.com/users/prathamesh-sonpatki","html_url":"https://github.com/prathamesh-sonpatki","followers_url":"https://api.github.com/users/prathamesh-sonpatki/followers","following_url":"https://api.github.com/users/prathamesh-sonpatki/following{/other_user}","gists_url":"https://api.github.com/users/prathamesh-sonpatki/gists{/gist_id}","starred_url":"https://api.github.com/users/prathamesh-sonpatki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prathamesh-sonpatki/subscriptions","organizations_url":"https://api.github.com/users/prathamesh-sonpatki/orgs","repos_url":"https://api.github.com/users/prathamesh-sonpatki/repos","events_url":"https://api.github.com/users/prathamesh-sonpatki/events{/privacy}","received_events_url":"https://api.github.com/users/prathamesh-sonpatki/received_events","type":"User","site_admin":false},"body":"We already have a `cable.js` in application templates in railties. Should we refer to it instead of duplicating here? I have seen similar duplicate file for application_mailer.rb too in mailer_generator template. We can remove duplicate file there too.","created_at":"2016-04-12T17:27:39Z","updated_at":"2016-04-12T17:27:39Z","html_url":"https://github.com/rails/rails/pull/24524#discussion_r59417212","pull_request_url":"https://api.github.com/repos/rails/rails/pulls/24524","_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/comments/59417212"},"html":{"href":"https://github.com/rails/rails/pull/24524#discussion_r59417212"},"pull_request":{"href":"https://api.github.com/repos/rails/rails/pulls/24524"}}},"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/24524","id":66195797,"html_url":"https://github.com/rails/rails/pull/24524","diff_url":"https://github.com/rails/rails/pull/24524.diff","patch_url":"https://github.com/rails/rails/pull/24524.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/24524","number":24524,"state":"open","locked":false,"title":"Generate `cable.js` file if does not exist when generating channel","user":{"login":"prathamesh-sonpatki","id":621238,"avatar_url":"https://avatars.githubusercontent.com/u/621238?v=3","gravatar_id":"","url":"https://api.github.com/users/prathamesh-sonpatki","html_url":"https://github.com/prathamesh-sonpatki","followers_url":"https://api.github.com/users/prathamesh-sonpatki/followers","following_url":"https://api.github.com/users/prathamesh-sonpatki/following{/other_user}","gists_url":"https://api.github.com/users/prathamesh-sonpatki/gists{/gist_id}","starred_url":"https://api.github.com/users/prathamesh-sonpatki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prathamesh-sonpatki/subscriptions","organizations_url":"https://api.github.com/users/prathamesh-sonpatki/orgs","repos_url":"https://api.github.com/users/prathamesh-sonpatki/repos","events_url":"https://api.github.com/users/prathamesh-sonpatki/events{/privacy}","received_events_url":"https://api.github.com/users/prathamesh-sonpatki/received_events","type":"User","site_admin":false},"body":"- Before this, while generating a channel, we were not creating\r\n  `cable.js` if it does not already exist.\r\n- We have similar code for application mailer here -\r\n  https://github.com/rails/rails/commit/0b3ae023d27197417541932632055cd6be4810c4.\r\n- Based on the comment -\r\n  https://github.com/rails/rails/issues/24418#issuecomment-205421995.\r\n\r\nr? @jeremy ","created_at":"2016-04-12T17:24:42Z","updated_at":"2016-04-12T17:27:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"758358032aae0fb21bd9a87b2b543f8908d414b8","assignee":{"login":"jeremy","id":199,"avatar_url":"https://avatars.githubusercontent.com/u/199?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremy","html_url":"https://github.com/jeremy","followers_url":"https://api.github.com/users/jeremy/followers","following_url":"https://api.github.com/users/jeremy/following{/other_user}","gists_url":"https://api.github.com/users/jeremy/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremy/subscriptions","organizations_url":"https://api.github.com/users/jeremy/orgs","repos_url":"https://api.github.com/users/jeremy/repos","events_url":"https://api.github.com/users/jeremy/events{/privacy}","received_events_url":"https://api.github.com/users/jeremy/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/24524/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/24524/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/24524/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/d0023deb74c8093900f0d703bb5c68eb766e5bdd","head":{"label":"prathamesh-sonpatki:cablejs-for-channels","ref":"cablejs-for-channels","sha":"d0023deb74c8093900f0d703bb5c68eb766e5bdd","user":{"login":"prathamesh-sonpatki","id":621238,"avatar_url":"https://avatars.githubusercontent.com/u/621238?v=3","gravatar_id":"","url":"https://api.github.com/users/prathamesh-sonpatki","html_url":"https://github.com/prathamesh-sonpatki","followers_url":"https://api.github.com/users/prathamesh-sonpatki/followers","following_url":"https://api.github.com/users/prathamesh-sonpatki/following{/other_user}","gists_url":"https://api.github.com/users/prathamesh-sonpatki/gists{/gist_id}","starred_url":"https://api.github.com/users/prathamesh-sonpatki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prathamesh-sonpatki/subscriptions","organizations_url":"https://api.github.com/users/prathamesh-sonpatki/orgs","repos_url":"https://api.github.com/users/prathamesh-sonpatki/repos","events_url":"https://api.github.com/users/prathamesh-sonpatki/events{/privacy}","received_events_url":"https://api.github.com/users/prathamesh-sonpatki/received_events","type":"User","site_admin":false},"repo":{"id":5762217,"name":"rails","full_name":"prathamesh-sonpatki/rails","owner":{"login":"prathamesh-sonpatki","id":621238,"avatar_url":"https://avatars.githubusercontent.com/u/621238?v=3","gravatar_id":"","url":"https://api.github.com/users/prathamesh-sonpatki","html_url":"https://github.com/prathamesh-sonpatki","followers_url":"https://api.github.com/users/prathamesh-sonpatki/followers","following_url":"https://api.github.com/users/prathamesh-sonpatki/following{/other_user}","gists_url":"https://api.github.com/users/prathamesh-sonpatki/gists{/gist_id}","starred_url":"https://api.github.com/users/prathamesh-sonpatki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prathamesh-sonpatki/subscriptions","organizations_url":"https://api.github.com/users/prathamesh-sonpatki/orgs","repos_url":"https://api.github.com/users/prathamesh-sonpatki/repos","events_url":"https://api.github.com/users/prathamesh-sonpatki/events{/privacy}","received_events_url":"https://api.github.com/users/prathamesh-sonpatki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/prathamesh-sonpatki/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/prathamesh-sonpatki/rails","forks_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/forks","keys_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/teams","hooks_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/hooks","issue_events_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/issues/events{/number}","events_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/events","assignees_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/assignees{/user}","branches_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/branches{/branch}","tags_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/tags","blobs_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/languages","stargazers_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/stargazers","contributors_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/contributors","subscribers_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/subscribers","subscription_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/subscription","commits_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/contents/{+path}","compare_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/merges","archive_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/downloads","issues_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/issues{/number}","pulls_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/labels{/name}","releases_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/releases{/id}","deployments_url":"https://api.github.com/repos/prathamesh-sonpatki/rails/deployments","created_at":"2012-09-11T08:43:31Z","updated_at":"2015-07-07T02:34:42Z","pushed_at":"2016-04-12T17:24:21Z","git_url":"git://github.com/prathamesh-sonpatki/rails.git","ssh_url":"git@github.com:prathamesh-sonpatki/rails.git","clone_url":"https://github.com/prathamesh-sonpatki/rails.git","svn_url":"https://github.com/prathamesh-sonpatki/rails","homepage":"http://rubyonrails.org","size":117662,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"rails:master","ref":"master","sha":"714ab8cb5976587470c8487720094c1efb2ba9a2","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":8514,"name":"rails","full_name":"rails/rails","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/rails","description":"Ruby on Rails","fork":false,"url":"https://api.github.com/repos/rails/rails","forks_url":"https://api.github.com/repos/rails/rails/forks","keys_url":"https://api.github.com/repos/rails/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails/teams","hooks_url":"https://api.github.com/repos/rails/rails/hooks","issue_events_url":"https://api.github.com/repos/rails/rails/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails/events","assignees_url":"https://api.github.com/repos/rails/rails/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails/tags","blobs_url":"https://api.github.com/repos/rails/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails/languages","stargazers_url":"https://api.github.com/repos/rails/rails/stargazers","contributors_url":"https://api.github.com/repos/rails/rails/contributors","subscribers_url":"https://api.github.com/repos/rails/rails/subscribers","subscription_url":"https://api.github.com/repos/rails/rails/subscription","commits_url":"https://api.github.com/repos/rails/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/rails/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails/merges","archive_url":"https://api.github.com/repos/rails/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails/downloads","issues_url":"https://api.github.com/repos/rails/rails/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails/releases{/id}","deployments_url":"https://api.github.com/repos/rails/rails/deployments","created_at":"2008-04-11T02:19:47Z","updated_at":"2016-04-12T17:23:42Z","pushed_at":"2016-04-12T17:24:44Z","git_url":"git://github.com/rails/rails.git","ssh_url":"git@github.com:rails/rails.git","clone_url":"https://github.com/rails/rails.git","svn_url":"https://github.com/rails/rails","homepage":"http://rubyonrails.org","size":331351,"stargazers_count":30597,"watchers_count":30597,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12427,"mirror_url":null,"open_issues_count":932,"forks":12427,"open_issues":932,"watchers":30597,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/24524"},"html":{"href":"https://github.com/rails/rails/pull/24524"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/24524"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/24524/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/24524/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/24524/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/d0023deb74c8093900f0d703bb5c68eb766e5bdd"}}}}