{"action":"created","comment":{"url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/pulls/comments/77281432","id":77281432,"diff_hunk":"@@ -0,0 +1,75 @@\n+class Student\n+  attr_accessor :id, :first_name, :last_name, :gender, :birthday, :email, :created_at, :updated_at\n+  def initialize (id, first_name, last_name, gender, birthday, email, created_at, updated_at)\n+    @id = id\n+    @first_name = first_name\n+    @last_name = last_name\n+    @gender = gender\n+    @birthday = birthday\n+    @email = email\n+    @created_at = created_at\n+    @updated_at = updated_at\n+  end\n+\n+  def self.all\n+    # return an array of Student instances for each row in the database\n+    where('1 = 1')\n+  end\n+\n+  def self.where(condition, *arg)\n+    rows = $db.execute(\"SELECT * FROM #{table_name} WHERE #{condition}\", arg)\n+    create_students(rows)\n+  end\n+\n+  def self.table_name\n+    'students'\n+  end\n+\n+  def table_name\n+    self.class.table_name\n+  end\n+\n+  def self.find(id)\n+    where('id = ? LIMIT 1', id).first\n+  end\n+  def save\n+    if id.nil?\n+      # insert into the database...\n+      insert_into = <<-SQL\n+      INSERT INTO #{table_name}\n+      (first_name, last_name, gender, birthday, email, created_at, updated_at)\n+      values (?,?,?,?,?, DATETIME('now'), DATETIME('now'))\n+      SQL\n+      $db.execute(insert_into, [first_name, last_name, gender, birthday, email])\n+      # ask the database what id it just assigned to the object\n+      self.id = $db.last_insert_row_id\n+    else\n+      # generate an upadate statement and update the updated_at field\n+\n+      update_students = <<-SQL\n+      UPDATE #{table_name}\n+      SET first_name = ?,\n+          last_name = ?,\n+          gender = ?,\n+          birthday = ?,\n+          email = ?,\n+          updated_at = DATETIME('now')\n+      WHERE id = ?\n+      SQL\n+      $db.execute(update_students, [first_name, last_name, gender, birthday, email, id])\n+    end\n+  end\n+\n+  def destroy\n+    $db.execute(\"DELETE FROM #{table_name} WHERE id = ?\", id)\n+  end\n+\n+\n+  private","path":"databases/kitten_maker/source/student_roster.rb","position":68,"original_position":68,"commit_id":"285f7ac01e94a3601c2bbc5fa80e39bfa0da008d","original_commit_id":"285f7ac01e94a3601c2bbc5fa80e39bfa0da008d","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Useless `private` access modifier.","created_at":"2016-09-02T01:23:20Z","updated_at":"2016-09-02T01:23:20Z","html_url":"https://github.com/christian-acuna/phase-0-tracks/pull/37#discussion_r77281432","pull_request_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/pulls/37","_links":{"self":{"href":"https://api.github.com/repos/christian-acuna/phase-0-tracks/pulls/comments/77281432"},"html":{"href":"https://github.com/christian-acuna/phase-0-tracks/pull/37#discussion_r77281432"},"pull_request":{"href":"https://api.github.com/repos/christian-acuna/phase-0-tracks/pulls/37"}}},"pull_request":{"url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/pulls/37","id":83732608,"html_url":"https://github.com/christian-acuna/phase-0-tracks/pull/37","diff_url":"https://github.com/christian-acuna/phase-0-tracks/pull/37.diff","patch_url":"https://github.com/christian-acuna/phase-0-tracks/pull/37.patch","issue_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/issues/37","number":37,"state":"open","locked":false,"title":"Student roster","user":{"login":"christian-acuna","id":7112158,"avatar_url":"https://avatars.githubusercontent.com/u/7112158?v=3","gravatar_id":"","url":"https://api.github.com/users/christian-acuna","html_url":"https://github.com/christian-acuna","followers_url":"https://api.github.com/users/christian-acuna/followers","following_url":"https://api.github.com/users/christian-acuna/following{/other_user}","gists_url":"https://api.github.com/users/christian-acuna/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-acuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-acuna/subscriptions","organizations_url":"https://api.github.com/users/christian-acuna/orgs","repos_url":"https://api.github.com/users/christian-acuna/repos","events_url":"https://api.github.com/users/christian-acuna/events{/privacy}","received_events_url":"https://api.github.com/users/christian-acuna/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-02T01:23:16Z","updated_at":"2016-09-02T01:23:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2bc14ac45ba3f82587ce6db4f396cb5babc6172e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/pulls/37/commits","review_comments_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/pulls/37/comments","review_comment_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/issues/37/comments","statuses_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/statuses/285f7ac01e94a3601c2bbc5fa80e39bfa0da008d","head":{"label":"christian-acuna:student_roster","ref":"student_roster","sha":"285f7ac01e94a3601c2bbc5fa80e39bfa0da008d","user":{"login":"christian-acuna","id":7112158,"avatar_url":"https://avatars.githubusercontent.com/u/7112158?v=3","gravatar_id":"","url":"https://api.github.com/users/christian-acuna","html_url":"https://github.com/christian-acuna","followers_url":"https://api.github.com/users/christian-acuna/followers","following_url":"https://api.github.com/users/christian-acuna/following{/other_user}","gists_url":"https://api.github.com/users/christian-acuna/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-acuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-acuna/subscriptions","organizations_url":"https://api.github.com/users/christian-acuna/orgs","repos_url":"https://api.github.com/users/christian-acuna/repos","events_url":"https://api.github.com/users/christian-acuna/events{/privacy}","received_events_url":"https://api.github.com/users/christian-acuna/received_events","type":"User","site_admin":false},"repo":{"id":63519290,"name":"phase-0-tracks","full_name":"christian-acuna/phase-0-tracks","owner":{"login":"christian-acuna","id":7112158,"avatar_url":"https://avatars.githubusercontent.com/u/7112158?v=3","gravatar_id":"","url":"https://api.github.com/users/christian-acuna","html_url":"https://github.com/christian-acuna","followers_url":"https://api.github.com/users/christian-acuna/followers","following_url":"https://api.github.com/users/christian-acuna/following{/other_user}","gists_url":"https://api.github.com/users/christian-acuna/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-acuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-acuna/subscriptions","organizations_url":"https://api.github.com/users/christian-acuna/orgs","repos_url":"https://api.github.com/users/christian-acuna/repos","events_url":"https://api.github.com/users/christian-acuna/events{/privacy}","received_events_url":"https://api.github.com/users/christian-acuna/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/christian-acuna/phase-0-tracks","description":null,"fork":true,"url":"https://api.github.com/repos/christian-acuna/phase-0-tracks","forks_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/forks","keys_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/teams","hooks_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/hooks","issue_events_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/issues/events{/number}","events_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/events","assignees_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/assignees{/user}","branches_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/branches{/branch}","tags_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/tags","blobs_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/git/refs{/sha}","trees_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/statuses/{sha}","languages_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/languages","stargazers_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/stargazers","contributors_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/contributors","subscribers_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/subscribers","subscription_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/subscription","commits_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/commits{/sha}","git_commits_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/git/commits{/sha}","comments_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/comments{/number}","issue_comment_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/issues/comments{/number}","contents_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/contents/{+path}","compare_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/merges","archive_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/downloads","issues_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/issues{/number}","pulls_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/pulls{/number}","milestones_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/milestones{/number}","notifications_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/labels{/name}","releases_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/releases{/id}","deployments_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/deployments","created_at":"2016-07-17T07:09:04Z","updated_at":"2016-08-23T02:16:08Z","pushed_at":"2016-09-02T01:23:16Z","git_url":"git://github.com/christian-acuna/phase-0-tracks.git","ssh_url":"git@github.com:christian-acuna/phase-0-tracks.git","clone_url":"https://github.com/christian-acuna/phase-0-tracks.git","svn_url":"https://github.com/christian-acuna/phase-0-tracks","homepage":null,"size":4628,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"christian-acuna:master","ref":"master","sha":"1fdba9d9378239ddeda6bbf3144f1be77105ac06","user":{"login":"christian-acuna","id":7112158,"avatar_url":"https://avatars.githubusercontent.com/u/7112158?v=3","gravatar_id":"","url":"https://api.github.com/users/christian-acuna","html_url":"https://github.com/christian-acuna","followers_url":"https://api.github.com/users/christian-acuna/followers","following_url":"https://api.github.com/users/christian-acuna/following{/other_user}","gists_url":"https://api.github.com/users/christian-acuna/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-acuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-acuna/subscriptions","organizations_url":"https://api.github.com/users/christian-acuna/orgs","repos_url":"https://api.github.com/users/christian-acuna/repos","events_url":"https://api.github.com/users/christian-acuna/events{/privacy}","received_events_url":"https://api.github.com/users/christian-acuna/received_events","type":"User","site_admin":false},"repo":{"id":63519290,"name":"phase-0-tracks","full_name":"christian-acuna/phase-0-tracks","owner":{"login":"christian-acuna","id":7112158,"avatar_url":"https://avatars.githubusercontent.com/u/7112158?v=3","gravatar_id":"","url":"https://api.github.com/users/christian-acuna","html_url":"https://github.com/christian-acuna","followers_url":"https://api.github.com/users/christian-acuna/followers","following_url":"https://api.github.com/users/christian-acuna/following{/other_user}","gists_url":"https://api.github.com/users/christian-acuna/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-acuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-acuna/subscriptions","organizations_url":"https://api.github.com/users/christian-acuna/orgs","repos_url":"https://api.github.com/users/christian-acuna/repos","events_url":"https://api.github.com/users/christian-acuna/events{/privacy}","received_events_url":"https://api.github.com/users/christian-acuna/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/christian-acuna/phase-0-tracks","description":null,"fork":true,"url":"https://api.github.com/repos/christian-acuna/phase-0-tracks","forks_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/forks","keys_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/teams","hooks_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/hooks","issue_events_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/issues/events{/number}","events_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/events","assignees_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/assignees{/user}","branches_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/branches{/branch}","tags_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/tags","blobs_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/git/refs{/sha}","trees_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/statuses/{sha}","languages_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/languages","stargazers_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/stargazers","contributors_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/contributors","subscribers_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/subscribers","subscription_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/subscription","commits_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/commits{/sha}","git_commits_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/git/commits{/sha}","comments_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/comments{/number}","issue_comment_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/issues/comments{/number}","contents_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/contents/{+path}","compare_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/merges","archive_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/downloads","issues_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/issues{/number}","pulls_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/pulls{/number}","milestones_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/milestones{/number}","notifications_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/labels{/name}","releases_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/releases{/id}","deployments_url":"https://api.github.com/repos/christian-acuna/phase-0-tracks/deployments","created_at":"2016-07-17T07:09:04Z","updated_at":"2016-08-23T02:16:08Z","pushed_at":"2016-09-02T01:23:16Z","git_url":"git://github.com/christian-acuna/phase-0-tracks.git","ssh_url":"git@github.com:christian-acuna/phase-0-tracks.git","clone_url":"https://github.com/christian-acuna/phase-0-tracks.git","svn_url":"https://github.com/christian-acuna/phase-0-tracks","homepage":null,"size":4628,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/christian-acuna/phase-0-tracks/pulls/37"},"html":{"href":"https://github.com/christian-acuna/phase-0-tracks/pull/37"},"issue":{"href":"https://api.github.com/repos/christian-acuna/phase-0-tracks/issues/37"},"comments":{"href":"https://api.github.com/repos/christian-acuna/phase-0-tracks/issues/37/comments"},"review_comments":{"href":"https://api.github.com/repos/christian-acuna/phase-0-tracks/pulls/37/comments"},"review_comment":{"href":"https://api.github.com/repos/christian-acuna/phase-0-tracks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/christian-acuna/phase-0-tracks/pulls/37/commits"},"statuses":{"href":"https://api.github.com/repos/christian-acuna/phase-0-tracks/statuses/285f7ac01e94a3601c2bbc5fa80e39bfa0da008d"}}}}
{"actor":{"display_login":"houndci-bot"}}