{"action":"created","comment":{"url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/pulls/comments/25605316","id":25605316,"diff_hunk":"@@ -5,6 +5,14 @@ class Course < ActiveRecord::Base\n                                OR lower(title) like ?\",\n                                \"%#{q.to_s.downcase.gsub(/\\s+/,'')}%\", \"%#{q.to_s.downcase}%\") }\n \n+  # Get all prereq info from the database.\n+  # Return an array of arrays of courses.\n+  def prerequisites\n+    Prerequisite.where(postrequisite: self).reduce([]) do |arr, prereq|\n+      arr << Course.where('id IN (?)', prereq.prerequisite_ids)\n+    end\n+  end","path":"app/models/course.rb","position":10,"original_position":10,"commit_id":"2e7026ea69659c8e156a858773beaa6d87d27b20","original_commit_id":"2e7026ea69659c8e156a858773beaa6d87d27b20","user":{"login":"ajm188","id":4276638,"avatar_url":"https://avatars.githubusercontent.com/u/4276638?v=3","gravatar_id":"","url":"https://api.github.com/users/ajm188","html_url":"https://github.com/ajm188","followers_url":"https://api.github.com/users/ajm188/followers","following_url":"https://api.github.com/users/ajm188/following{/other_user}","gists_url":"https://api.github.com/users/ajm188/gists{/gist_id}","starred_url":"https://api.github.com/users/ajm188/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajm188/subscriptions","organizations_url":"https://api.github.com/users/ajm188/orgs","repos_url":"https://api.github.com/users/ajm188/repos","events_url":"https://api.github.com/users/ajm188/events{/privacy}","received_events_url":"https://api.github.com/users/ajm188/received_events","type":"User","site_admin":false},"body":"I'm not sure if that will work with it being an array in the database...I'll look into it though","created_at":"2015-03-02T15:18:56Z","updated_at":"2015-03-02T15:18:56Z","html_url":"https://github.com/Aaronneyer/the_jolly_advisor/pull/17#discussion_r25605316","pull_request_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/pulls/comments/25605316"},"html":{"href":"https://github.com/Aaronneyer/the_jolly_advisor/pull/17#discussion_r25605316"},"pull_request":{"href":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/pulls/17","id":30220140,"html_url":"https://github.com/Aaronneyer/the_jolly_advisor/pull/17","diff_url":"https://github.com/Aaronneyer/the_jolly_advisor/pull/17.diff","patch_url":"https://github.com/Aaronneyer/the_jolly_advisor/pull/17.patch","issue_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/issues/17","number":17,"state":"open","locked":false,"title":"add prerequisites info to courses show page","user":{"login":"ajm188","id":4276638,"avatar_url":"https://avatars.githubusercontent.com/u/4276638?v=3","gravatar_id":"","url":"https://api.github.com/users/ajm188","html_url":"https://github.com/ajm188","followers_url":"https://api.github.com/users/ajm188/followers","following_url":"https://api.github.com/users/ajm188/following{/other_user}","gists_url":"https://api.github.com/users/ajm188/gists{/gist_id}","starred_url":"https://api.github.com/users/ajm188/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajm188/subscriptions","organizations_url":"https://api.github.com/users/ajm188/orgs","repos_url":"https://api.github.com/users/ajm188/repos","events_url":"https://api.github.com/users/ajm188/events{/privacy}","received_events_url":"https://api.github.com/users/ajm188/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-28T07:01:28Z","updated_at":"2015-03-02T15:18:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e8bb237b53dbfc41a18af6371f98915548655c0","assignee":{"login":"Aaronneyer","id":1574698,"avatar_url":"https://avatars.githubusercontent.com/u/1574698?v=3","gravatar_id":"","url":"https://api.github.com/users/Aaronneyer","html_url":"https://github.com/Aaronneyer","followers_url":"https://api.github.com/users/Aaronneyer/followers","following_url":"https://api.github.com/users/Aaronneyer/following{/other_user}","gists_url":"https://api.github.com/users/Aaronneyer/gists{/gist_id}","starred_url":"https://api.github.com/users/Aaronneyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aaronneyer/subscriptions","organizations_url":"https://api.github.com/users/Aaronneyer/orgs","repos_url":"https://api.github.com/users/Aaronneyer/repos","events_url":"https://api.github.com/users/Aaronneyer/events{/privacy}","received_events_url":"https://api.github.com/users/Aaronneyer/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/pulls/17/commits","review_comments_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/pulls/17/comments","review_comment_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/issues/17/comments","statuses_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/statuses/2e7026ea69659c8e156a858773beaa6d87d27b20","head":{"label":"Aaronneyer:andrew-dev","ref":"andrew-dev","sha":"2e7026ea69659c8e156a858773beaa6d87d27b20","user":{"login":"Aaronneyer","id":1574698,"avatar_url":"https://avatars.githubusercontent.com/u/1574698?v=3","gravatar_id":"","url":"https://api.github.com/users/Aaronneyer","html_url":"https://github.com/Aaronneyer","followers_url":"https://api.github.com/users/Aaronneyer/followers","following_url":"https://api.github.com/users/Aaronneyer/following{/other_user}","gists_url":"https://api.github.com/users/Aaronneyer/gists{/gist_id}","starred_url":"https://api.github.com/users/Aaronneyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aaronneyer/subscriptions","organizations_url":"https://api.github.com/users/Aaronneyer/orgs","repos_url":"https://api.github.com/users/Aaronneyer/repos","events_url":"https://api.github.com/users/Aaronneyer/events{/privacy}","received_events_url":"https://api.github.com/users/Aaronneyer/received_events","type":"User","site_admin":false},"repo":{"id":30626128,"name":"the_jolly_advisor","full_name":"Aaronneyer/the_jolly_advisor","owner":{"login":"Aaronneyer","id":1574698,"avatar_url":"https://avatars.githubusercontent.com/u/1574698?v=3","gravatar_id":"","url":"https://api.github.com/users/Aaronneyer","html_url":"https://github.com/Aaronneyer","followers_url":"https://api.github.com/users/Aaronneyer/followers","following_url":"https://api.github.com/users/Aaronneyer/following{/other_user}","gists_url":"https://api.github.com/users/Aaronneyer/gists{/gist_id}","starred_url":"https://api.github.com/users/Aaronneyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aaronneyer/subscriptions","organizations_url":"https://api.github.com/users/Aaronneyer/orgs","repos_url":"https://api.github.com/users/Aaronneyer/repos","events_url":"https://api.github.com/users/Aaronneyer/events{/privacy}","received_events_url":"https://api.github.com/users/Aaronneyer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Aaronneyer/the_jolly_advisor","description":"Get Jolly!","fork":false,"url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor","forks_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/forks","keys_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/teams","hooks_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/hooks","issue_events_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/issues/events{/number}","events_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/events","assignees_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/assignees{/user}","branches_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/branches{/branch}","tags_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/tags","blobs_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/git/refs{/sha}","trees_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/statuses/{sha}","languages_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/languages","stargazers_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/stargazers","contributors_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/contributors","subscribers_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/subscribers","subscription_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/subscription","commits_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/commits{/sha}","git_commits_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/git/commits{/sha}","comments_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/comments{/number}","issue_comment_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/issues/comments{/number}","contents_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/contents/{+path}","compare_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/merges","archive_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/downloads","issues_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/issues{/number}","pulls_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/pulls{/number}","milestones_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/milestones{/number}","notifications_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/labels{/name}","releases_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/releases{/id}","created_at":"2015-02-11T02:25:13Z","updated_at":"2015-02-27T19:33:47Z","pushed_at":"2015-02-28T07:00:53Z","git_url":"git://github.com/Aaronneyer/the_jolly_advisor.git","ssh_url":"git@github.com:Aaronneyer/the_jolly_advisor.git","clone_url":"https://github.com/Aaronneyer/the_jolly_advisor.git","svn_url":"https://github.com/Aaronneyer/the_jolly_advisor","homepage":null,"size":388,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"Aaronneyer:master","ref":"master","sha":"8b149b61c1867dfe82c7a8a8badbeb0336b0860f","user":{"login":"Aaronneyer","id":1574698,"avatar_url":"https://avatars.githubusercontent.com/u/1574698?v=3","gravatar_id":"","url":"https://api.github.com/users/Aaronneyer","html_url":"https://github.com/Aaronneyer","followers_url":"https://api.github.com/users/Aaronneyer/followers","following_url":"https://api.github.com/users/Aaronneyer/following{/other_user}","gists_url":"https://api.github.com/users/Aaronneyer/gists{/gist_id}","starred_url":"https://api.github.com/users/Aaronneyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aaronneyer/subscriptions","organizations_url":"https://api.github.com/users/Aaronneyer/orgs","repos_url":"https://api.github.com/users/Aaronneyer/repos","events_url":"https://api.github.com/users/Aaronneyer/events{/privacy}","received_events_url":"https://api.github.com/users/Aaronneyer/received_events","type":"User","site_admin":false},"repo":{"id":30626128,"name":"the_jolly_advisor","full_name":"Aaronneyer/the_jolly_advisor","owner":{"login":"Aaronneyer","id":1574698,"avatar_url":"https://avatars.githubusercontent.com/u/1574698?v=3","gravatar_id":"","url":"https://api.github.com/users/Aaronneyer","html_url":"https://github.com/Aaronneyer","followers_url":"https://api.github.com/users/Aaronneyer/followers","following_url":"https://api.github.com/users/Aaronneyer/following{/other_user}","gists_url":"https://api.github.com/users/Aaronneyer/gists{/gist_id}","starred_url":"https://api.github.com/users/Aaronneyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aaronneyer/subscriptions","organizations_url":"https://api.github.com/users/Aaronneyer/orgs","repos_url":"https://api.github.com/users/Aaronneyer/repos","events_url":"https://api.github.com/users/Aaronneyer/events{/privacy}","received_events_url":"https://api.github.com/users/Aaronneyer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Aaronneyer/the_jolly_advisor","description":"Get Jolly!","fork":false,"url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor","forks_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/forks","keys_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/teams","hooks_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/hooks","issue_events_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/issues/events{/number}","events_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/events","assignees_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/assignees{/user}","branches_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/branches{/branch}","tags_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/tags","blobs_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/git/refs{/sha}","trees_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/statuses/{sha}","languages_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/languages","stargazers_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/stargazers","contributors_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/contributors","subscribers_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/subscribers","subscription_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/subscription","commits_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/commits{/sha}","git_commits_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/git/commits{/sha}","comments_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/comments{/number}","issue_comment_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/issues/comments{/number}","contents_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/contents/{+path}","compare_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/merges","archive_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/downloads","issues_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/issues{/number}","pulls_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/pulls{/number}","milestones_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/milestones{/number}","notifications_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/labels{/name}","releases_url":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/releases{/id}","created_at":"2015-02-11T02:25:13Z","updated_at":"2015-02-27T19:33:47Z","pushed_at":"2015-02-28T07:00:53Z","git_url":"git://github.com/Aaronneyer/the_jolly_advisor.git","ssh_url":"git@github.com:Aaronneyer/the_jolly_advisor.git","clone_url":"https://github.com/Aaronneyer/the_jolly_advisor.git","svn_url":"https://github.com/Aaronneyer/the_jolly_advisor","homepage":null,"size":388,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/pulls/17"},"html":{"href":"https://github.com/Aaronneyer/the_jolly_advisor/pull/17"},"issue":{"href":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/issues/17"},"comments":{"href":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/Aaronneyer/the_jolly_advisor/statuses/2e7026ea69659c8e156a858773beaa6d87d27b20"}}}}