{"action":"created","issue":{"url":"https://api.github.com/repos/calblueprint/edge-yl/issues/715","labels_url":"https://api.github.com/repos/calblueprint/edge-yl/issues/715/labels{/name}","comments_url":"https://api.github.com/repos/calblueprint/edge-yl/issues/715/comments","events_url":"https://api.github.com/repos/calblueprint/edge-yl/issues/715/events","html_url":"https://github.com/calblueprint/edge-yl/issues/715","id":123559232,"number":715,"title":"Set up schools and students as polymorphic \"commentable\"s","user":{"login":"warrenshen","id":8787796,"avatar_url":"https://avatars.githubusercontent.com/u/8787796?v=3","gravatar_id":"","url":"https://api.github.com/users/warrenshen","html_url":"https://github.com/warrenshen","followers_url":"https://api.github.com/users/warrenshen/followers","following_url":"https://api.github.com/users/warrenshen/following{/other_user}","gists_url":"https://api.github.com/users/warrenshen/gists{/gist_id}","starred_url":"https://api.github.com/users/warrenshen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warrenshen/subscriptions","organizations_url":"https://api.github.com/users/warrenshen/orgs","repos_url":"https://api.github.com/users/warrenshen/repos","events_url":"https://api.github.com/users/warrenshen/events{/privacy}","received_events_url":"https://api.github.com/users/warrenshen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/calblueprint/edge-yl/labels/models","name":"models","color":"006b75"}],"state":"open","locked":false,"assignee":{"login":"unzunz","id":7827524,"avatar_url":"https://avatars.githubusercontent.com/u/7827524?v=3","gravatar_id":"","url":"https://api.github.com/users/unzunz","html_url":"https://github.com/unzunz","followers_url":"https://api.github.com/users/unzunz/followers","following_url":"https://api.github.com/users/unzunz/following{/other_user}","gists_url":"https://api.github.com/users/unzunz/gists{/gist_id}","starred_url":"https://api.github.com/users/unzunz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unzunz/subscriptions","organizations_url":"https://api.github.com/users/unzunz/orgs","repos_url":"https://api.github.com/users/unzunz/repos","events_url":"https://api.github.com/users/unzunz/events{/privacy}","received_events_url":"https://api.github.com/users/unzunz/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-12-22T21:27:10Z","updated_at":"2015-12-28T13:43:57Z","closed_at":null,"body":"This will include polymorphism (search \"polymorphic relationships rails\")! Essentially, we want to be able to comment on both `school`s an `student`s, whereas now we can only comment on `student`s.\r\n\r\nWhen we create visits, notice we have the polymorphic: true declaration.\r\n\r\n```\r\nclass CreateVisits < ActiveRecord::Migration\r\n  def change\r\n    create_table :visits do |t|\r\n\r\n      t.references :visitable, polymorphic: true, index: true\r\n      t.references :user, index: true\r\n\r\n      t.timestamps null: false\r\n    end\r\n  end\r\nend\r\n```\r\n\r\nSimilarly, we'll need to set that up with comments, something like:\r\n`t.references :commentable, polymorphic: true, index: true`\r\n\r\nThere's a bit more we need to do in the school and student models afterwards, see if you can learn from some examples (`visit` model would be a good place to start)!"},"comment":{"url":"https://api.github.com/repos/calblueprint/edge-yl/issues/comments/167574115","html_url":"https://github.com/calblueprint/edge-yl/issues/715#issuecomment-167574115","issue_url":"https://api.github.com/repos/calblueprint/edge-yl/issues/715","id":167574115,"user":{"login":"warrenshen","id":8787796,"avatar_url":"https://avatars.githubusercontent.com/u/8787796?v=3","gravatar_id":"","url":"https://api.github.com/users/warrenshen","html_url":"https://github.com/warrenshen","followers_url":"https://api.github.com/users/warrenshen/followers","following_url":"https://api.github.com/users/warrenshen/following{/other_user}","gists_url":"https://api.github.com/users/warrenshen/gists{/gist_id}","starred_url":"https://api.github.com/users/warrenshen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warrenshen/subscriptions","organizations_url":"https://api.github.com/users/warrenshen/orgs","repos_url":"https://api.github.com/users/warrenshen/repos","events_url":"https://api.github.com/users/warrenshen/events{/privacy}","received_events_url":"https://api.github.com/users/warrenshen/received_events","type":"User","site_admin":false},"created_at":"2015-12-28T13:43:57Z","updated_at":"2015-12-28T13:43:57Z","body":"The description here was probably confusing, I meant to use the `Visit` class as an example for the `Comment` class!"}}