{"action":"created","comment":{"url":"https://api.github.com/repos/robwise/drexel_msis_planner/pulls/comments/30017155","id":30017155,"diff_hunk":"@@ -14,65 +17,79 @@ def respond_to_missing?(method_name, include_private = false)\n   end\n \n   def taken_quarter_sections\n-    first = user.taken_courses.minimum(:quarter)\n-    last = user.taken_courses.maximum(:quarter)\n+    first = Quarter.new(statistics.first_taken_quarter)\n+    last = Quarter.new(statistics.last_taken_quarter)\n     quarters = Quarter.from(first: first, last: last)\n-    generate_quarter_sections_for(quarters, @plan.user.taken_courses)\n+    generate_quarter_sections_for(quarters, taken_courses)\n   end\n \n   def planned_quarter_sections\n-    first = Quarter.new(user.taken_courses.maximum(:quarter)).next_quarter.code\n-    last = planned_courses.maximum(:quarter)\n+    first = Quarter.new(statistics.last_taken_quarter).next_quarter.code\n+    last = Quarter.new(statistics.last_planned_quarter)\n     quarters = Quarter.from(first: first, last: last)\n-    generate_quarter_sections_for(quarters, @plan.planned_courses)\n+    generate_quarter_sections_for(quarters, planned_courses)\n   end\n \n-  def generate_quarter_sections_for(quarters, courses)\n-    # courses = user.taken_courses + planned_courses\n-    qs_array = []\n-    quarters.each do |quarter|\n-      section_title = \"#{quarter.code}- \" + quarter.humanize\n-      qs = { title: section_title, code: quarter.code }\n-      qs[:courses] = courses.where(quarter: quarter.code)\n-      qs_array << qs\n-    end\n-    qs_array\n+  def pretty_planned_completion\n+    # TODO: add logic if the degree is completed to show that\n+    planned_completion = statistics.planned_completion_date\n+    return \"No Courses Planned\" if planned_completion.nil?\n+    statistics.planned_completion_date.to_datetime.strftime(\"%B %Y\")\n+  end\n+\n+  def pretty_duration\n+    \"#{ statistics.duration_in_quarters } Quarters (#{ statistics.duration_in_years } years)\"\n   end\n \n   def submit_text\n-    if @plan.new_record?\n-      \"Create\"\n-    else\n-      \"Update\"\n-    end\n+    @plan.new_record? ? \"Create\" : \"Update\"\n   end\n \n   def form_model\n-    if @plan.new_record?\n-      [@plan.user, @plan]\n-    else\n-      @plan\n-    end\n+    @plan.new_record? ? [@plan.user, @plan] : @plan\n   end\n \n-  def required_course_credits\n-    degree_requirement_counts[:required_course]\n+  # Takes a symbol or String argument (:required_course, :free_elective,\n+  # :distribution_course, or :total_credits)\n+  def progress_bar_for(progress_type)\n+    progress_type = progress_type.to_s\n+    if progress_type == \"total_credits\"\n+      numerator = @plan.statistics.total_credits\n+      denominator = Course::TOTAL_CREDITS_TO_GRADUATE\n+    else\n+      numerator = @plan.statistics.send(\"#{progress_type}_count\")\n+      denominator = eval \"Course::#{progress_type.upcase}_COURSES_TO_GRADUATE\"","path":"app/decorators/plan_decorator.rb","position":85,"original_position":85,"commit_id":"09cba8032ef46a2af3961aab43c751a76ae13a56","original_commit_id":"09cba8032ef46a2af3961aab43c751a76ae13a56","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"The use of `eval` is a serious security risk.","created_at":"2015-05-11T07:22:55Z","updated_at":"2015-05-11T07:22:55Z","html_url":"https://github.com/robwise/drexel_msis_planner/pull/23#discussion_r30017155","pull_request_url":"https://api.github.com/repos/robwise/drexel_msis_planner/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/robwise/drexel_msis_planner/pulls/comments/30017155"},"html":{"href":"https://github.com/robwise/drexel_msis_planner/pull/23#discussion_r30017155"},"pull_request":{"href":"https://api.github.com/repos/robwise/drexel_msis_planner/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/robwise/drexel_msis_planner/pulls/23","id":35102264,"html_url":"https://github.com/robwise/drexel_msis_planner/pull/23","diff_url":"https://github.com/robwise/drexel_msis_planner/pull/23.diff","patch_url":"https://github.com/robwise/drexel_msis_planner/pull/23.patch","issue_url":"https://api.github.com/repos/robwise/drexel_msis_planner/issues/23","number":23,"state":"open","locked":false,"title":"restyle planner view and navigation","user":{"login":"robwise","id":6173488,"avatar_url":"https://avatars.githubusercontent.com/u/6173488?v=3","gravatar_id":"","url":"https://api.github.com/users/robwise","html_url":"https://github.com/robwise","followers_url":"https://api.github.com/users/robwise/followers","following_url":"https://api.github.com/users/robwise/following{/other_user}","gists_url":"https://api.github.com/users/robwise/gists{/gist_id}","starred_url":"https://api.github.com/users/robwise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robwise/subscriptions","organizations_url":"https://api.github.com/users/robwise/orgs","repos_url":"https://api.github.com/users/robwise/repos","events_url":"https://api.github.com/users/robwise/events{/privacy}","received_events_url":"https://api.github.com/users/robwise/received_events","type":"User","site_admin":false},"body":"- moved business logic related to plan statistics to PlanStatisticsService.rb\r\n- stopped extending Bootstrap classes via SCSS and instead just use classes directly in views\r\n- add gravatar to navigation\r\n- add brand to navbar\r\n- changed ordering of navigation links\r\n- renamed \"plan\" navigation link to \"planner\"\r\n- various other minor changes","created_at":"2015-05-11T07:05:55Z","updated_at":"2015-05-11T07:22:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4902b1fc86f483e859bf4010567150477c063b97","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/robwise/drexel_msis_planner/pulls/23/commits","review_comments_url":"https://api.github.com/repos/robwise/drexel_msis_planner/pulls/23/comments","review_comment_url":"https://api.github.com/repos/robwise/drexel_msis_planner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/robwise/drexel_msis_planner/issues/23/comments","statuses_url":"https://api.github.com/repos/robwise/drexel_msis_planner/statuses/09cba8032ef46a2af3961aab43c751a76ae13a56","head":{"label":"robwise:restyling","ref":"restyling","sha":"09cba8032ef46a2af3961aab43c751a76ae13a56","user":{"login":"robwise","id":6173488,"avatar_url":"https://avatars.githubusercontent.com/u/6173488?v=3","gravatar_id":"","url":"https://api.github.com/users/robwise","html_url":"https://github.com/robwise","followers_url":"https://api.github.com/users/robwise/followers","following_url":"https://api.github.com/users/robwise/following{/other_user}","gists_url":"https://api.github.com/users/robwise/gists{/gist_id}","starred_url":"https://api.github.com/users/robwise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robwise/subscriptions","organizations_url":"https://api.github.com/users/robwise/orgs","repos_url":"https://api.github.com/users/robwise/repos","events_url":"https://api.github.com/users/robwise/events{/privacy}","received_events_url":"https://api.github.com/users/robwise/received_events","type":"User","site_admin":false},"repo":{"id":23376886,"name":"drexel_msis_planner","full_name":"robwise/drexel_msis_planner","owner":{"login":"robwise","id":6173488,"avatar_url":"https://avatars.githubusercontent.com/u/6173488?v=3","gravatar_id":"","url":"https://api.github.com/users/robwise","html_url":"https://github.com/robwise","followers_url":"https://api.github.com/users/robwise/followers","following_url":"https://api.github.com/users/robwise/following{/other_user}","gists_url":"https://api.github.com/users/robwise/gists{/gist_id}","starred_url":"https://api.github.com/users/robwise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robwise/subscriptions","organizations_url":"https://api.github.com/users/robwise/orgs","repos_url":"https://api.github.com/users/robwise/repos","events_url":"https://api.github.com/users/robwise/events{/privacy}","received_events_url":"https://api.github.com/users/robwise/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/robwise/drexel_msis_planner","description":"Ruby on Rails project for a degree planner for MSIS students at Drexel University","fork":false,"url":"https://api.github.com/repos/robwise/drexel_msis_planner","forks_url":"https://api.github.com/repos/robwise/drexel_msis_planner/forks","keys_url":"https://api.github.com/repos/robwise/drexel_msis_planner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/robwise/drexel_msis_planner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/robwise/drexel_msis_planner/teams","hooks_url":"https://api.github.com/repos/robwise/drexel_msis_planner/hooks","issue_events_url":"https://api.github.com/repos/robwise/drexel_msis_planner/issues/events{/number}","events_url":"https://api.github.com/repos/robwise/drexel_msis_planner/events","assignees_url":"https://api.github.com/repos/robwise/drexel_msis_planner/assignees{/user}","branches_url":"https://api.github.com/repos/robwise/drexel_msis_planner/branches{/branch}","tags_url":"https://api.github.com/repos/robwise/drexel_msis_planner/tags","blobs_url":"https://api.github.com/repos/robwise/drexel_msis_planner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/robwise/drexel_msis_planner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/robwise/drexel_msis_planner/git/refs{/sha}","trees_url":"https://api.github.com/repos/robwise/drexel_msis_planner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/robwise/drexel_msis_planner/statuses/{sha}","languages_url":"https://api.github.com/repos/robwise/drexel_msis_planner/languages","stargazers_url":"https://api.github.com/repos/robwise/drexel_msis_planner/stargazers","contributors_url":"https://api.github.com/repos/robwise/drexel_msis_planner/contributors","subscribers_url":"https://api.github.com/repos/robwise/drexel_msis_planner/subscribers","subscription_url":"https://api.github.com/repos/robwise/drexel_msis_planner/subscription","commits_url":"https://api.github.com/repos/robwise/drexel_msis_planner/commits{/sha}","git_commits_url":"https://api.github.com/repos/robwise/drexel_msis_planner/git/commits{/sha}","comments_url":"https://api.github.com/repos/robwise/drexel_msis_planner/comments{/number}","issue_comment_url":"https://api.github.com/repos/robwise/drexel_msis_planner/issues/comments{/number}","contents_url":"https://api.github.com/repos/robwise/drexel_msis_planner/contents/{+path}","compare_url":"https://api.github.com/repos/robwise/drexel_msis_planner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/robwise/drexel_msis_planner/merges","archive_url":"https://api.github.com/repos/robwise/drexel_msis_planner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/robwise/drexel_msis_planner/downloads","issues_url":"https://api.github.com/repos/robwise/drexel_msis_planner/issues{/number}","pulls_url":"https://api.github.com/repos/robwise/drexel_msis_planner/pulls{/number}","milestones_url":"https://api.github.com/repos/robwise/drexel_msis_planner/milestones{/number}","notifications_url":"https://api.github.com/repos/robwise/drexel_msis_planner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/robwise/drexel_msis_planner/labels{/name}","releases_url":"https://api.github.com/repos/robwise/drexel_msis_planner/releases{/id}","created_at":"2014-08-27T04:35:46Z","updated_at":"2015-05-07T00:23:17Z","pushed_at":"2015-05-11T07:22:47Z","git_url":"git://github.com/robwise/drexel_msis_planner.git","ssh_url":"git@github.com:robwise/drexel_msis_planner.git","clone_url":"https://github.com/robwise/drexel_msis_planner.git","svn_url":"https://github.com/robwise/drexel_msis_planner","homepage":"https://still-sands-7957.herokuapp.com/","size":1044,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"robwise:master","ref":"master","sha":"bd916dca73e4949ab3d35b02708b71a5c9cdf375","user":{"login":"robwise","id":6173488,"avatar_url":"https://avatars.githubusercontent.com/u/6173488?v=3","gravatar_id":"","url":"https://api.github.com/users/robwise","html_url":"https://github.com/robwise","followers_url":"https://api.github.com/users/robwise/followers","following_url":"https://api.github.com/users/robwise/following{/other_user}","gists_url":"https://api.github.com/users/robwise/gists{/gist_id}","starred_url":"https://api.github.com/users/robwise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robwise/subscriptions","organizations_url":"https://api.github.com/users/robwise/orgs","repos_url":"https://api.github.com/users/robwise/repos","events_url":"https://api.github.com/users/robwise/events{/privacy}","received_events_url":"https://api.github.com/users/robwise/received_events","type":"User","site_admin":false},"repo":{"id":23376886,"name":"drexel_msis_planner","full_name":"robwise/drexel_msis_planner","owner":{"login":"robwise","id":6173488,"avatar_url":"https://avatars.githubusercontent.com/u/6173488?v=3","gravatar_id":"","url":"https://api.github.com/users/robwise","html_url":"https://github.com/robwise","followers_url":"https://api.github.com/users/robwise/followers","following_url":"https://api.github.com/users/robwise/following{/other_user}","gists_url":"https://api.github.com/users/robwise/gists{/gist_id}","starred_url":"https://api.github.com/users/robwise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robwise/subscriptions","organizations_url":"https://api.github.com/users/robwise/orgs","repos_url":"https://api.github.com/users/robwise/repos","events_url":"https://api.github.com/users/robwise/events{/privacy}","received_events_url":"https://api.github.com/users/robwise/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/robwise/drexel_msis_planner","description":"Ruby on Rails project for a degree planner for MSIS students at Drexel University","fork":false,"url":"https://api.github.com/repos/robwise/drexel_msis_planner","forks_url":"https://api.github.com/repos/robwise/drexel_msis_planner/forks","keys_url":"https://api.github.com/repos/robwise/drexel_msis_planner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/robwise/drexel_msis_planner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/robwise/drexel_msis_planner/teams","hooks_url":"https://api.github.com/repos/robwise/drexel_msis_planner/hooks","issue_events_url":"https://api.github.com/repos/robwise/drexel_msis_planner/issues/events{/number}","events_url":"https://api.github.com/repos/robwise/drexel_msis_planner/events","assignees_url":"https://api.github.com/repos/robwise/drexel_msis_planner/assignees{/user}","branches_url":"https://api.github.com/repos/robwise/drexel_msis_planner/branches{/branch}","tags_url":"https://api.github.com/repos/robwise/drexel_msis_planner/tags","blobs_url":"https://api.github.com/repos/robwise/drexel_msis_planner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/robwise/drexel_msis_planner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/robwise/drexel_msis_planner/git/refs{/sha}","trees_url":"https://api.github.com/repos/robwise/drexel_msis_planner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/robwise/drexel_msis_planner/statuses/{sha}","languages_url":"https://api.github.com/repos/robwise/drexel_msis_planner/languages","stargazers_url":"https://api.github.com/repos/robwise/drexel_msis_planner/stargazers","contributors_url":"https://api.github.com/repos/robwise/drexel_msis_planner/contributors","subscribers_url":"https://api.github.com/repos/robwise/drexel_msis_planner/subscribers","subscription_url":"https://api.github.com/repos/robwise/drexel_msis_planner/subscription","commits_url":"https://api.github.com/repos/robwise/drexel_msis_planner/commits{/sha}","git_commits_url":"https://api.github.com/repos/robwise/drexel_msis_planner/git/commits{/sha}","comments_url":"https://api.github.com/repos/robwise/drexel_msis_planner/comments{/number}","issue_comment_url":"https://api.github.com/repos/robwise/drexel_msis_planner/issues/comments{/number}","contents_url":"https://api.github.com/repos/robwise/drexel_msis_planner/contents/{+path}","compare_url":"https://api.github.com/repos/robwise/drexel_msis_planner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/robwise/drexel_msis_planner/merges","archive_url":"https://api.github.com/repos/robwise/drexel_msis_planner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/robwise/drexel_msis_planner/downloads","issues_url":"https://api.github.com/repos/robwise/drexel_msis_planner/issues{/number}","pulls_url":"https://api.github.com/repos/robwise/drexel_msis_planner/pulls{/number}","milestones_url":"https://api.github.com/repos/robwise/drexel_msis_planner/milestones{/number}","notifications_url":"https://api.github.com/repos/robwise/drexel_msis_planner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/robwise/drexel_msis_planner/labels{/name}","releases_url":"https://api.github.com/repos/robwise/drexel_msis_planner/releases{/id}","created_at":"2014-08-27T04:35:46Z","updated_at":"2015-05-07T00:23:17Z","pushed_at":"2015-05-11T07:22:47Z","git_url":"git://github.com/robwise/drexel_msis_planner.git","ssh_url":"git@github.com:robwise/drexel_msis_planner.git","clone_url":"https://github.com/robwise/drexel_msis_planner.git","svn_url":"https://github.com/robwise/drexel_msis_planner","homepage":"https://still-sands-7957.herokuapp.com/","size":1044,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/robwise/drexel_msis_planner/pulls/23"},"html":{"href":"https://github.com/robwise/drexel_msis_planner/pull/23"},"issue":{"href":"https://api.github.com/repos/robwise/drexel_msis_planner/issues/23"},"comments":{"href":"https://api.github.com/repos/robwise/drexel_msis_planner/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/robwise/drexel_msis_planner/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/robwise/drexel_msis_planner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/robwise/drexel_msis_planner/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/robwise/drexel_msis_planner/statuses/09cba8032ef46a2af3961aab43c751a76ae13a56"}}}}