{"action":"created","comment":{"url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/comments/34876560","id":34876560,"diff_hunk":"@@ -15,8 +15,9 @@ def new\n \n   def create\n     @campaign_page = CampaignPage.new(@page_params)\n-    @campaign_page.compile_html\n+    return switch_template(@campaign_page, :new) if params[:switch_template]","path":"app/controllers/campaign_pages_controller.rb","position":5,"original_position":5,"commit_id":"e697d5195e07e7c4739075be3867c8454aa4e18c","original_commit_id":"e697d5195e07e7c4739075be3867c8454aa4e18c","user":{"login":"osahyoun","id":12949,"avatar_url":"https://avatars.githubusercontent.com/u/12949?v=3","gravatar_id":"","url":"https://api.github.com/users/osahyoun","html_url":"https://github.com/osahyoun","followers_url":"https://api.github.com/users/osahyoun/followers","following_url":"https://api.github.com/users/osahyoun/following{/other_user}","gists_url":"https://api.github.com/users/osahyoun/gists{/gist_id}","starred_url":"https://api.github.com/users/osahyoun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osahyoun/subscriptions","organizations_url":"https://api.github.com/users/osahyoun/orgs","repos_url":"https://api.github.com/users/osahyoun/repos","events_url":"https://api.github.com/users/osahyoun/events{/privacy}","received_events_url":"https://api.github.com/users/osahyoun/received_events","type":"User","site_admin":false},"body":"You could make this more DRY. Why not have all of this detail handled by another class? Right now, this controller is doing too much: \"Provide CRUD actions for campaign pages **AND** deal with situations where client wants to switch templates.\" Can we ditch the second clause?","created_at":"2015-07-17T09:53:30Z","updated_at":"2015-07-17T09:53:30Z","html_url":"https://github.com/SumOfUs/Champaign/pull/62#discussion_r34876560","pull_request_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/62","_links":{"self":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/comments/34876560"},"html":{"href":"https://github.com/SumOfUs/Champaign/pull/62#discussion_r34876560"},"pull_request":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/62","id":40195088,"html_url":"https://github.com/SumOfUs/Champaign/pull/62","diff_url":"https://github.com/SumOfUs/Champaign/pull/62.diff","patch_url":"https://github.com/SumOfUs/Champaign/pull/62.patch","issue_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/62","number":62,"state":"open","locked":false,"title":"allow template switching on campaign page form","user":{"login":"NealJMD","id":102218,"avatar_url":"https://avatars.githubusercontent.com/u/102218?v=3","gravatar_id":"","url":"https://api.github.com/users/NealJMD","html_url":"https://github.com/NealJMD","followers_url":"https://api.github.com/users/NealJMD/followers","following_url":"https://api.github.com/users/NealJMD/following{/other_user}","gists_url":"https://api.github.com/users/NealJMD/gists{/gist_id}","starred_url":"https://api.github.com/users/NealJMD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NealJMD/subscriptions","organizations_url":"https://api.github.com/users/NealJMD/orgs","repos_url":"https://api.github.com/users/NealJMD/repos","events_url":"https://api.github.com/users/NealJMD/events{/privacy}","received_events_url":"https://api.github.com/users/NealJMD/received_events","type":"User","site_admin":false},"body":"Campaigners should be able to apply templates at any point to a page, whether existing or brand new, and have the page figure out how to reuse as many widgets as possible. ","created_at":"2015-07-17T02:18:44Z","updated_at":"2015-07-17T09:53:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"050916e735568944cd9a45269e6541ee5498ef8e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/62/commits","review_comments_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/62/comments","review_comment_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/62/comments","statuses_url":"https://api.github.com/repos/SumOfUs/Champaign/statuses/e697d5195e07e7c4739075be3867c8454aa4e18c","head":{"label":"SumOfUs:page-templater","ref":"page-templater","sha":"e697d5195e07e7c4739075be3867c8454aa4e18c","user":{"login":"SumOfUs","id":7574652,"avatar_url":"https://avatars.githubusercontent.com/u/7574652?v=3","gravatar_id":"","url":"https://api.github.com/users/SumOfUs","html_url":"https://github.com/SumOfUs","followers_url":"https://api.github.com/users/SumOfUs/followers","following_url":"https://api.github.com/users/SumOfUs/following{/other_user}","gists_url":"https://api.github.com/users/SumOfUs/gists{/gist_id}","starred_url":"https://api.github.com/users/SumOfUs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SumOfUs/subscriptions","organizations_url":"https://api.github.com/users/SumOfUs/orgs","repos_url":"https://api.github.com/users/SumOfUs/repos","events_url":"https://api.github.com/users/SumOfUs/events{/privacy}","received_events_url":"https://api.github.com/users/SumOfUs/received_events","type":"Organization","site_admin":false},"repo":{"id":33684818,"name":"Champaign","full_name":"SumOfUs/Champaign","owner":{"login":"SumOfUs","id":7574652,"avatar_url":"https://avatars.githubusercontent.com/u/7574652?v=3","gravatar_id":"","url":"https://api.github.com/users/SumOfUs","html_url":"https://github.com/SumOfUs","followers_url":"https://api.github.com/users/SumOfUs/followers","following_url":"https://api.github.com/users/SumOfUs/following{/other_user}","gists_url":"https://api.github.com/users/SumOfUs/gists{/gist_id}","starred_url":"https://api.github.com/users/SumOfUs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SumOfUs/subscriptions","organizations_url":"https://api.github.com/users/SumOfUs/orgs","repos_url":"https://api.github.com/users/SumOfUs/repos","events_url":"https://api.github.com/users/SumOfUs/events{/privacy}","received_events_url":"https://api.github.com/users/SumOfUs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SumOfUs/Champaign","description":"SumOfUs Online Campaign Platform.","fork":false,"url":"https://api.github.com/repos/SumOfUs/Champaign","forks_url":"https://api.github.com/repos/SumOfUs/Champaign/forks","keys_url":"https://api.github.com/repos/SumOfUs/Champaign/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SumOfUs/Champaign/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SumOfUs/Champaign/teams","hooks_url":"https://api.github.com/repos/SumOfUs/Champaign/hooks","issue_events_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/events{/number}","events_url":"https://api.github.com/repos/SumOfUs/Champaign/events","assignees_url":"https://api.github.com/repos/SumOfUs/Champaign/assignees{/user}","branches_url":"https://api.github.com/repos/SumOfUs/Champaign/branches{/branch}","tags_url":"https://api.github.com/repos/SumOfUs/Champaign/tags","blobs_url":"https://api.github.com/repos/SumOfUs/Champaign/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SumOfUs/Champaign/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SumOfUs/Champaign/git/refs{/sha}","trees_url":"https://api.github.com/repos/SumOfUs/Champaign/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SumOfUs/Champaign/statuses/{sha}","languages_url":"https://api.github.com/repos/SumOfUs/Champaign/languages","stargazers_url":"https://api.github.com/repos/SumOfUs/Champaign/stargazers","contributors_url":"https://api.github.com/repos/SumOfUs/Champaign/contributors","subscribers_url":"https://api.github.com/repos/SumOfUs/Champaign/subscribers","subscription_url":"https://api.github.com/repos/SumOfUs/Champaign/subscription","commits_url":"https://api.github.com/repos/SumOfUs/Champaign/commits{/sha}","git_commits_url":"https://api.github.com/repos/SumOfUs/Champaign/git/commits{/sha}","comments_url":"https://api.github.com/repos/SumOfUs/Champaign/comments{/number}","issue_comment_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/comments{/number}","contents_url":"https://api.github.com/repos/SumOfUs/Champaign/contents/{+path}","compare_url":"https://api.github.com/repos/SumOfUs/Champaign/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SumOfUs/Champaign/merges","archive_url":"https://api.github.com/repos/SumOfUs/Champaign/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SumOfUs/Champaign/downloads","issues_url":"https://api.github.com/repos/SumOfUs/Champaign/issues{/number}","pulls_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls{/number}","milestones_url":"https://api.github.com/repos/SumOfUs/Champaign/milestones{/number}","notifications_url":"https://api.github.com/repos/SumOfUs/Champaign/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SumOfUs/Champaign/labels{/name}","releases_url":"https://api.github.com/repos/SumOfUs/Champaign/releases{/id}","created_at":"2015-04-09T18:16:20Z","updated_at":"2015-05-28T16:43:05Z","pushed_at":"2015-07-17T09:31:09Z","git_url":"git://github.com/SumOfUs/Champaign.git","ssh_url":"git@github.com:SumOfUs/Champaign.git","clone_url":"https://github.com/SumOfUs/Champaign.git","svn_url":"https://github.com/SumOfUs/Champaign","homepage":null,"size":1474,"stargazers_count":7,"watchers_count":7,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":14,"forks":1,"open_issues":14,"watchers":7,"default_branch":"development"}},"base":{"label":"SumOfUs:development","ref":"development","sha":"061b8c2001e06ac1d376c7605b3aac468557b23e","user":{"login":"SumOfUs","id":7574652,"avatar_url":"https://avatars.githubusercontent.com/u/7574652?v=3","gravatar_id":"","url":"https://api.github.com/users/SumOfUs","html_url":"https://github.com/SumOfUs","followers_url":"https://api.github.com/users/SumOfUs/followers","following_url":"https://api.github.com/users/SumOfUs/following{/other_user}","gists_url":"https://api.github.com/users/SumOfUs/gists{/gist_id}","starred_url":"https://api.github.com/users/SumOfUs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SumOfUs/subscriptions","organizations_url":"https://api.github.com/users/SumOfUs/orgs","repos_url":"https://api.github.com/users/SumOfUs/repos","events_url":"https://api.github.com/users/SumOfUs/events{/privacy}","received_events_url":"https://api.github.com/users/SumOfUs/received_events","type":"Organization","site_admin":false},"repo":{"id":33684818,"name":"Champaign","full_name":"SumOfUs/Champaign","owner":{"login":"SumOfUs","id":7574652,"avatar_url":"https://avatars.githubusercontent.com/u/7574652?v=3","gravatar_id":"","url":"https://api.github.com/users/SumOfUs","html_url":"https://github.com/SumOfUs","followers_url":"https://api.github.com/users/SumOfUs/followers","following_url":"https://api.github.com/users/SumOfUs/following{/other_user}","gists_url":"https://api.github.com/users/SumOfUs/gists{/gist_id}","starred_url":"https://api.github.com/users/SumOfUs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SumOfUs/subscriptions","organizations_url":"https://api.github.com/users/SumOfUs/orgs","repos_url":"https://api.github.com/users/SumOfUs/repos","events_url":"https://api.github.com/users/SumOfUs/events{/privacy}","received_events_url":"https://api.github.com/users/SumOfUs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SumOfUs/Champaign","description":"SumOfUs Online Campaign Platform.","fork":false,"url":"https://api.github.com/repos/SumOfUs/Champaign","forks_url":"https://api.github.com/repos/SumOfUs/Champaign/forks","keys_url":"https://api.github.com/repos/SumOfUs/Champaign/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SumOfUs/Champaign/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SumOfUs/Champaign/teams","hooks_url":"https://api.github.com/repos/SumOfUs/Champaign/hooks","issue_events_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/events{/number}","events_url":"https://api.github.com/repos/SumOfUs/Champaign/events","assignees_url":"https://api.github.com/repos/SumOfUs/Champaign/assignees{/user}","branches_url":"https://api.github.com/repos/SumOfUs/Champaign/branches{/branch}","tags_url":"https://api.github.com/repos/SumOfUs/Champaign/tags","blobs_url":"https://api.github.com/repos/SumOfUs/Champaign/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SumOfUs/Champaign/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SumOfUs/Champaign/git/refs{/sha}","trees_url":"https://api.github.com/repos/SumOfUs/Champaign/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SumOfUs/Champaign/statuses/{sha}","languages_url":"https://api.github.com/repos/SumOfUs/Champaign/languages","stargazers_url":"https://api.github.com/repos/SumOfUs/Champaign/stargazers","contributors_url":"https://api.github.com/repos/SumOfUs/Champaign/contributors","subscribers_url":"https://api.github.com/repos/SumOfUs/Champaign/subscribers","subscription_url":"https://api.github.com/repos/SumOfUs/Champaign/subscription","commits_url":"https://api.github.com/repos/SumOfUs/Champaign/commits{/sha}","git_commits_url":"https://api.github.com/repos/SumOfUs/Champaign/git/commits{/sha}","comments_url":"https://api.github.com/repos/SumOfUs/Champaign/comments{/number}","issue_comment_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/comments{/number}","contents_url":"https://api.github.com/repos/SumOfUs/Champaign/contents/{+path}","compare_url":"https://api.github.com/repos/SumOfUs/Champaign/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SumOfUs/Champaign/merges","archive_url":"https://api.github.com/repos/SumOfUs/Champaign/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SumOfUs/Champaign/downloads","issues_url":"https://api.github.com/repos/SumOfUs/Champaign/issues{/number}","pulls_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls{/number}","milestones_url":"https://api.github.com/repos/SumOfUs/Champaign/milestones{/number}","notifications_url":"https://api.github.com/repos/SumOfUs/Champaign/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SumOfUs/Champaign/labels{/name}","releases_url":"https://api.github.com/repos/SumOfUs/Champaign/releases{/id}","created_at":"2015-04-09T18:16:20Z","updated_at":"2015-05-28T16:43:05Z","pushed_at":"2015-07-17T09:31:09Z","git_url":"git://github.com/SumOfUs/Champaign.git","ssh_url":"git@github.com:SumOfUs/Champaign.git","clone_url":"https://github.com/SumOfUs/Champaign.git","svn_url":"https://github.com/SumOfUs/Champaign","homepage":null,"size":1474,"stargazers_count":7,"watchers_count":7,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":14,"forks":1,"open_issues":14,"watchers":7,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/62"},"html":{"href":"https://github.com/SumOfUs/Champaign/pull/62"},"issue":{"href":"https://api.github.com/repos/SumOfUs/Champaign/issues/62"},"comments":{"href":"https://api.github.com/repos/SumOfUs/Champaign/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/SumOfUs/Champaign/statuses/e697d5195e07e7c4739075be3867c8454aa4e18c"}}}}