{"action":"created","comment":{"url":"https://api.github.com/repos/iExperience/ixjourney/pulls/comments/78287796","id":78287796,"diff_hunk":"@@ -4,6 +4,9 @@ class InterviewSubmission < ActiveType::Object\n   \n   before_save :validate_interview_response\n   after_save :create_interview_response_questions\n+  after_save :track_interview_submitted","path":"app/models/interview_submission.rb","position":4,"original_position":4,"commit_id":"13876f3a39487478d8b5ec4e532d99379622fb7e","original_commit_id":"13876f3a39487478d8b5ec4e532d99379622fb7e","user":{"login":"khanotations","id":1446043,"avatar_url":"https://avatars.githubusercontent.com/u/1446043?v=3","gravatar_id":"","url":"https://api.github.com/users/khanotations","html_url":"https://github.com/khanotations","followers_url":"https://api.github.com/users/khanotations/followers","following_url":"https://api.github.com/users/khanotations/following{/other_user}","gists_url":"https://api.github.com/users/khanotations/gists{/gist_id}","starred_url":"https://api.github.com/users/khanotations/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khanotations/subscriptions","organizations_url":"https://api.github.com/users/khanotations/orgs","repos_url":"https://api.github.com/users/khanotations/repos","events_url":"https://api.github.com/users/khanotations/events{/privacy}","received_events_url":"https://api.github.com/users/khanotations/received_events","type":"User","site_admin":false},"body":"are these after saves or after creates?","created_at":"2016-09-11T04:43:42Z","updated_at":"2016-09-11T04:43:42Z","html_url":"https://github.com/iExperience/ixjourney/pull/35#discussion_r78287796","pull_request_url":"https://api.github.com/repos/iExperience/ixjourney/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/iExperience/ixjourney/pulls/comments/78287796"},"html":{"href":"https://github.com/iExperience/ixjourney/pull/35#discussion_r78287796"},"pull_request":{"href":"https://api.github.com/repos/iExperience/ixjourney/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/iExperience/ixjourney/pulls/35","id":80881795,"html_url":"https://github.com/iExperience/ixjourney/pull/35","diff_url":"https://github.com/iExperience/ixjourney/pull/35.diff","patch_url":"https://github.com/iExperience/ixjourney/pull/35.patch","issue_url":"https://api.github.com/repos/iExperience/ixjourney/issues/35","number":35,"state":"open","locked":false,"title":"Events tracking + Segment","user":{"login":"JoshBroomberg","id":12767768,"avatar_url":"https://avatars.githubusercontent.com/u/12767768?v=3","gravatar_id":"","url":"https://api.github.com/users/JoshBroomberg","html_url":"https://github.com/JoshBroomberg","followers_url":"https://api.github.com/users/JoshBroomberg/followers","following_url":"https://api.github.com/users/JoshBroomberg/following{/other_user}","gists_url":"https://api.github.com/users/JoshBroomberg/gists{/gist_id}","starred_url":"https://api.github.com/users/JoshBroomberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoshBroomberg/subscriptions","organizations_url":"https://api.github.com/users/JoshBroomberg/orgs","repos_url":"https://api.github.com/users/JoshBroomberg/repos","events_url":"https://api.github.com/users/JoshBroomberg/events{/privacy}","received_events_url":"https://api.github.com/users/JoshBroomberg/received_events","type":"User","site_admin":false},"body":"Depends on #37 \r\n\r\nTO DO\r\n- Finalise a list of user attributes to track\r\n- Decide on when to do updates to user. (Is after save correct?)\r\n- Decide on which events to track and build them out (very quick)\r\n\r\nThis is the foundational PR for the events service. It introduces:\r\n\r\n**Objects**\r\n- An `Event` model which is:\r\n - Owned by an eventable\r\n - Has an event type enum\r\n - Has a json attribute called data\r\n\r\n- Event submodels for each event type.\r\n\r\n These event models define custom event data via non_persisted active type attributes. A clever little before_save in the base event class collects all the values from these AT attributes and stores them into the json data attribute before save.  *This allows much cleaner event object instantiation, allowing things like validations on the custom data. The alternative is to pass in a json hash to the event from the event service. Much messier* \r\n\r\n (Check out the `written_application_started` event for custom data - none is present  in `sign_up`)\r\n\r\n- An `EventService` to wrap the creation of events.\r\n\r\n**Flow**\r\n- Controller calls `EventService` method to register an event, passing in required models. \r\n- Event service creates a new event of the relevant class, filling in both common persisted attributes and the custom ActiveType attributes. \r\n- The base event class uses a before_save to collect together all the non_persisted custom data and save it to the json `data` field.\r\n- The base event class triggers an after_create to sync the event to wherever.\r\n\r\n**Summary**\r\n This system is in place and working like a charm. Look forward to your comments. ","created_at":"2016-08-10T22:55:29Z","updated_at":"2016-09-11T04:43:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e16a72bf2e7d217d7cd5cbb40fedfddd62f19c9","assignee":{"login":"khanotations","id":1446043,"avatar_url":"https://avatars.githubusercontent.com/u/1446043?v=3","gravatar_id":"","url":"https://api.github.com/users/khanotations","html_url":"https://github.com/khanotations","followers_url":"https://api.github.com/users/khanotations/followers","following_url":"https://api.github.com/users/khanotations/following{/other_user}","gists_url":"https://api.github.com/users/khanotations/gists{/gist_id}","starred_url":"https://api.github.com/users/khanotations/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khanotations/subscriptions","organizations_url":"https://api.github.com/users/khanotations/orgs","repos_url":"https://api.github.com/users/khanotations/repos","events_url":"https://api.github.com/users/khanotations/events{/privacy}","received_events_url":"https://api.github.com/users/khanotations/received_events","type":"User","site_admin":false},"assignees":[{"login":"khanotations","id":1446043,"avatar_url":"https://avatars.githubusercontent.com/u/1446043?v=3","gravatar_id":"","url":"https://api.github.com/users/khanotations","html_url":"https://github.com/khanotations","followers_url":"https://api.github.com/users/khanotations/followers","following_url":"https://api.github.com/users/khanotations/following{/other_user}","gists_url":"https://api.github.com/users/khanotations/gists{/gist_id}","starred_url":"https://api.github.com/users/khanotations/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khanotations/subscriptions","organizations_url":"https://api.github.com/users/khanotations/orgs","repos_url":"https://api.github.com/users/khanotations/repos","events_url":"https://api.github.com/users/khanotations/events{/privacy}","received_events_url":"https://api.github.com/users/khanotations/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/iExperience/ixjourney/pulls/35/commits","review_comments_url":"https://api.github.com/repos/iExperience/ixjourney/pulls/35/comments","review_comment_url":"https://api.github.com/repos/iExperience/ixjourney/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iExperience/ixjourney/issues/35/comments","statuses_url":"https://api.github.com/repos/iExperience/ixjourney/statuses/13876f3a39487478d8b5ec4e532d99379622fb7e","head":{"label":"iExperience:events","ref":"events","sha":"13876f3a39487478d8b5ec4e532d99379622fb7e","user":{"login":"iExperience","id":7220596,"avatar_url":"https://avatars.githubusercontent.com/u/7220596?v=3","gravatar_id":"","url":"https://api.github.com/users/iExperience","html_url":"https://github.com/iExperience","followers_url":"https://api.github.com/users/iExperience/followers","following_url":"https://api.github.com/users/iExperience/following{/other_user}","gists_url":"https://api.github.com/users/iExperience/gists{/gist_id}","starred_url":"https://api.github.com/users/iExperience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iExperience/subscriptions","organizations_url":"https://api.github.com/users/iExperience/orgs","repos_url":"https://api.github.com/users/iExperience/repos","events_url":"https://api.github.com/users/iExperience/events{/privacy}","received_events_url":"https://api.github.com/users/iExperience/received_events","type":"Organization","site_admin":false},"repo":{"id":61960222,"name":"ixjourney","full_name":"iExperience/ixjourney","owner":{"login":"iExperience","id":7220596,"avatar_url":"https://avatars.githubusercontent.com/u/7220596?v=3","gravatar_id":"","url":"https://api.github.com/users/iExperience","html_url":"https://github.com/iExperience","followers_url":"https://api.github.com/users/iExperience/followers","following_url":"https://api.github.com/users/iExperience/following{/other_user}","gists_url":"https://api.github.com/users/iExperience/gists{/gist_id}","starred_url":"https://api.github.com/users/iExperience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iExperience/subscriptions","organizations_url":"https://api.github.com/users/iExperience/orgs","repos_url":"https://api.github.com/users/iExperience/repos","events_url":"https://api.github.com/users/iExperience/events{/privacy}","received_events_url":"https://api.github.com/users/iExperience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iExperience/ixjourney","description":"Second generation of the students portal","fork":false,"url":"https://api.github.com/repos/iExperience/ixjourney","forks_url":"https://api.github.com/repos/iExperience/ixjourney/forks","keys_url":"https://api.github.com/repos/iExperience/ixjourney/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iExperience/ixjourney/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iExperience/ixjourney/teams","hooks_url":"https://api.github.com/repos/iExperience/ixjourney/hooks","issue_events_url":"https://api.github.com/repos/iExperience/ixjourney/issues/events{/number}","events_url":"https://api.github.com/repos/iExperience/ixjourney/events","assignees_url":"https://api.github.com/repos/iExperience/ixjourney/assignees{/user}","branches_url":"https://api.github.com/repos/iExperience/ixjourney/branches{/branch}","tags_url":"https://api.github.com/repos/iExperience/ixjourney/tags","blobs_url":"https://api.github.com/repos/iExperience/ixjourney/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iExperience/ixjourney/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iExperience/ixjourney/git/refs{/sha}","trees_url":"https://api.github.com/repos/iExperience/ixjourney/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iExperience/ixjourney/statuses/{sha}","languages_url":"https://api.github.com/repos/iExperience/ixjourney/languages","stargazers_url":"https://api.github.com/repos/iExperience/ixjourney/stargazers","contributors_url":"https://api.github.com/repos/iExperience/ixjourney/contributors","subscribers_url":"https://api.github.com/repos/iExperience/ixjourney/subscribers","subscription_url":"https://api.github.com/repos/iExperience/ixjourney/subscription","commits_url":"https://api.github.com/repos/iExperience/ixjourney/commits{/sha}","git_commits_url":"https://api.github.com/repos/iExperience/ixjourney/git/commits{/sha}","comments_url":"https://api.github.com/repos/iExperience/ixjourney/comments{/number}","issue_comment_url":"https://api.github.com/repos/iExperience/ixjourney/issues/comments{/number}","contents_url":"https://api.github.com/repos/iExperience/ixjourney/contents/{+path}","compare_url":"https://api.github.com/repos/iExperience/ixjourney/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iExperience/ixjourney/merges","archive_url":"https://api.github.com/repos/iExperience/ixjourney/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iExperience/ixjourney/downloads","issues_url":"https://api.github.com/repos/iExperience/ixjourney/issues{/number}","pulls_url":"https://api.github.com/repos/iExperience/ixjourney/pulls{/number}","milestones_url":"https://api.github.com/repos/iExperience/ixjourney/milestones{/number}","notifications_url":"https://api.github.com/repos/iExperience/ixjourney/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iExperience/ixjourney/labels{/name}","releases_url":"https://api.github.com/repos/iExperience/ixjourney/releases{/id}","deployments_url":"https://api.github.com/repos/iExperience/ixjourney/deployments","created_at":"2016-06-25T20:22:40Z","updated_at":"2016-09-11T04:40:56Z","pushed_at":"2016-09-07T08:04:57Z","git_url":"git://github.com/iExperience/ixjourney.git","ssh_url":"git@github.com:iExperience/ixjourney.git","clone_url":"https://github.com/iExperience/ixjourney.git","svn_url":"https://github.com/iExperience/ixjourney","homepage":null,"size":11468,"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":12,"forks":0,"open_issues":12,"watchers":1,"default_branch":"master"}},"base":{"label":"iExperience:master","ref":"master","sha":"c8308fa557fb788a33caddd0c91daaffb2ea2f41","user":{"login":"iExperience","id":7220596,"avatar_url":"https://avatars.githubusercontent.com/u/7220596?v=3","gravatar_id":"","url":"https://api.github.com/users/iExperience","html_url":"https://github.com/iExperience","followers_url":"https://api.github.com/users/iExperience/followers","following_url":"https://api.github.com/users/iExperience/following{/other_user}","gists_url":"https://api.github.com/users/iExperience/gists{/gist_id}","starred_url":"https://api.github.com/users/iExperience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iExperience/subscriptions","organizations_url":"https://api.github.com/users/iExperience/orgs","repos_url":"https://api.github.com/users/iExperience/repos","events_url":"https://api.github.com/users/iExperience/events{/privacy}","received_events_url":"https://api.github.com/users/iExperience/received_events","type":"Organization","site_admin":false},"repo":{"id":61960222,"name":"ixjourney","full_name":"iExperience/ixjourney","owner":{"login":"iExperience","id":7220596,"avatar_url":"https://avatars.githubusercontent.com/u/7220596?v=3","gravatar_id":"","url":"https://api.github.com/users/iExperience","html_url":"https://github.com/iExperience","followers_url":"https://api.github.com/users/iExperience/followers","following_url":"https://api.github.com/users/iExperience/following{/other_user}","gists_url":"https://api.github.com/users/iExperience/gists{/gist_id}","starred_url":"https://api.github.com/users/iExperience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iExperience/subscriptions","organizations_url":"https://api.github.com/users/iExperience/orgs","repos_url":"https://api.github.com/users/iExperience/repos","events_url":"https://api.github.com/users/iExperience/events{/privacy}","received_events_url":"https://api.github.com/users/iExperience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iExperience/ixjourney","description":"Second generation of the students portal","fork":false,"url":"https://api.github.com/repos/iExperience/ixjourney","forks_url":"https://api.github.com/repos/iExperience/ixjourney/forks","keys_url":"https://api.github.com/repos/iExperience/ixjourney/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iExperience/ixjourney/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iExperience/ixjourney/teams","hooks_url":"https://api.github.com/repos/iExperience/ixjourney/hooks","issue_events_url":"https://api.github.com/repos/iExperience/ixjourney/issues/events{/number}","events_url":"https://api.github.com/repos/iExperience/ixjourney/events","assignees_url":"https://api.github.com/repos/iExperience/ixjourney/assignees{/user}","branches_url":"https://api.github.com/repos/iExperience/ixjourney/branches{/branch}","tags_url":"https://api.github.com/repos/iExperience/ixjourney/tags","blobs_url":"https://api.github.com/repos/iExperience/ixjourney/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iExperience/ixjourney/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iExperience/ixjourney/git/refs{/sha}","trees_url":"https://api.github.com/repos/iExperience/ixjourney/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iExperience/ixjourney/statuses/{sha}","languages_url":"https://api.github.com/repos/iExperience/ixjourney/languages","stargazers_url":"https://api.github.com/repos/iExperience/ixjourney/stargazers","contributors_url":"https://api.github.com/repos/iExperience/ixjourney/contributors","subscribers_url":"https://api.github.com/repos/iExperience/ixjourney/subscribers","subscription_url":"https://api.github.com/repos/iExperience/ixjourney/subscription","commits_url":"https://api.github.com/repos/iExperience/ixjourney/commits{/sha}","git_commits_url":"https://api.github.com/repos/iExperience/ixjourney/git/commits{/sha}","comments_url":"https://api.github.com/repos/iExperience/ixjourney/comments{/number}","issue_comment_url":"https://api.github.com/repos/iExperience/ixjourney/issues/comments{/number}","contents_url":"https://api.github.com/repos/iExperience/ixjourney/contents/{+path}","compare_url":"https://api.github.com/repos/iExperience/ixjourney/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iExperience/ixjourney/merges","archive_url":"https://api.github.com/repos/iExperience/ixjourney/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iExperience/ixjourney/downloads","issues_url":"https://api.github.com/repos/iExperience/ixjourney/issues{/number}","pulls_url":"https://api.github.com/repos/iExperience/ixjourney/pulls{/number}","milestones_url":"https://api.github.com/repos/iExperience/ixjourney/milestones{/number}","notifications_url":"https://api.github.com/repos/iExperience/ixjourney/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iExperience/ixjourney/labels{/name}","releases_url":"https://api.github.com/repos/iExperience/ixjourney/releases{/id}","deployments_url":"https://api.github.com/repos/iExperience/ixjourney/deployments","created_at":"2016-06-25T20:22:40Z","updated_at":"2016-09-11T04:40:56Z","pushed_at":"2016-09-07T08:04:57Z","git_url":"git://github.com/iExperience/ixjourney.git","ssh_url":"git@github.com:iExperience/ixjourney.git","clone_url":"https://github.com/iExperience/ixjourney.git","svn_url":"https://github.com/iExperience/ixjourney","homepage":null,"size":11468,"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":12,"forks":0,"open_issues":12,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iExperience/ixjourney/pulls/35"},"html":{"href":"https://github.com/iExperience/ixjourney/pull/35"},"issue":{"href":"https://api.github.com/repos/iExperience/ixjourney/issues/35"},"comments":{"href":"https://api.github.com/repos/iExperience/ixjourney/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/iExperience/ixjourney/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/iExperience/ixjourney/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iExperience/ixjourney/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/iExperience/ixjourney/statuses/13876f3a39487478d8b5ec4e532d99379622fb7e"}}}}
{"actor":{"display_login":"khanotations"}}