{"action":"created","comment":{"url":"https://api.github.com/repos/18F/C2/pulls/comments/52789281","id":52789281,"diff_hunk":"@@ -0,0 +1,19 @@\n+class AddTheVisitIdToModels < ActiveRecord::Migration\n+  def up\n+    add_column :proposals, :visit_id, :uuid\n+    add_column :comments, :visit_id, :uuid\n+    add_column :reports, :visit_id, :uuid\n+    add_foreign_key :proposals, :visits\n+    add_foreign_key :comments, :visits\n+    add_foreign_key :reports, :visits\n+  end\n+\n+  def down\n+    remove_foreign_key :proposals, :visits\n+    remove_foreign_key :comments, :visits\n+    remove_foreign_key :reports, :visits\n+    drop_column :proposals, :visit_id","path":"db/migrate/20160208173646_add_the_visit_id_to_models.rb","position":15,"original_position":15,"commit_id":"7523c98d6397b07698ad0abd58712c0a9e28f10a","original_commit_id":"7523c98d6397b07698ad0abd58712c0a9e28f10a","user":{"login":"rememberlenny","id":1332366,"avatar_url":"https://avatars.githubusercontent.com/u/1332366?v=3","gravatar_id":"","url":"https://api.github.com/users/rememberlenny","html_url":"https://github.com/rememberlenny","followers_url":"https://api.github.com/users/rememberlenny/followers","following_url":"https://api.github.com/users/rememberlenny/following{/other_user}","gists_url":"https://api.github.com/users/rememberlenny/gists{/gist_id}","starred_url":"https://api.github.com/users/rememberlenny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rememberlenny/subscriptions","organizations_url":"https://api.github.com/users/rememberlenny/orgs","repos_url":"https://api.github.com/users/rememberlenny/repos","events_url":"https://api.github.com/users/rememberlenny/events{/privacy}","received_events_url":"https://api.github.com/users/rememberlenny/received_events","type":"User","site_admin":false},"body":"@pkarman Got it!","created_at":"2016-02-12T19:47:38Z","updated_at":"2016-02-12T19:47:38Z","html_url":"https://github.com/18F/C2/pull/936#discussion_r52789281","pull_request_url":"https://api.github.com/repos/18F/C2/pulls/936","_links":{"self":{"href":"https://api.github.com/repos/18F/C2/pulls/comments/52789281"},"html":{"href":"https://github.com/18F/C2/pull/936#discussion_r52789281"},"pull_request":{"href":"https://api.github.com/repos/18F/C2/pulls/936"}}},"pull_request":{"url":"https://api.github.com/repos/18F/C2/pulls/936","id":58631787,"html_url":"https://github.com/18F/C2/pull/936","diff_url":"https://github.com/18F/C2/pull/936.diff","patch_url":"https://github.com/18F/C2/pull/936.patch","issue_url":"https://api.github.com/repos/18F/C2/issues/936","number":936,"state":"open","locked":false,"title":"Add event and visit tracking to the site using Ahoy","user":{"login":"rememberlenny","id":1332366,"avatar_url":"https://avatars.githubusercontent.com/u/1332366?v=3","gravatar_id":"","url":"https://api.github.com/users/rememberlenny","html_url":"https://github.com/rememberlenny","followers_url":"https://api.github.com/users/rememberlenny/followers","following_url":"https://api.github.com/users/rememberlenny/following{/other_user}","gists_url":"https://api.github.com/users/rememberlenny/gists{/gist_id}","starred_url":"https://api.github.com/users/rememberlenny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rememberlenny/subscriptions","organizations_url":"https://api.github.com/users/rememberlenny/orgs","repos_url":"https://api.github.com/users/rememberlenny/repos","events_url":"https://api.github.com/users/rememberlenny/events{/privacy}","received_events_url":"https://api.github.com/users/rememberlenny/received_events","type":"User","site_admin":false},"body":"Breaking up previous #929 to identify issue.\r\n\r\n## New Gems\r\nAdding new gem: ```ahoy_matey```\r\n\r\n## Database changes\r\nAdding table for ```visits``` and ```ahoy_events```. Adding column on ```proposals```, ```reports``` and ```comments``` for visit tracking.\r\n\r\n```visits``` and ```ahoy_events``` are used for tracking front-end and backend activity in relation to the logged on user. The events can be used to make details reports for error handling and observe user behavior.\r\n\r\n```visit_id``` column is added to ```proposals```, ```reports``` and ```comments``` to associate the visit of a user, when new instances are created. For example, the visit behavior leading up to a proposal being created can be tracked and observed.\r\n\r\n# How\r\n*Magic*\r\n\r\n---\r\n\r\nBut seriously, ```ahoy``` has great documentation that can be viewed here:\r\n\r\n- [Ahoy repository](https://github.com/ankane/ahoy)\r\n\r\n## Admin\r\n\r\nAdded two fields in ActiveAdmin for Tracking.\r\n\r\n![screen shot 2016-02-05 at 1 04 31 pm](https://cloud.githubusercontent.com/assets/1332366/12854594/94244b2c-cc08-11e5-8f4c-22be59ffbadc.png)","created_at":"2016-02-08T16:25:20Z","updated_at":"2016-02-12T19:47:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ff60d6a112e662f33c774446ee7f606b9c2d155c","assignee":{"login":"rememberlenny","id":1332366,"avatar_url":"https://avatars.githubusercontent.com/u/1332366?v=3","gravatar_id":"","url":"https://api.github.com/users/rememberlenny","html_url":"https://github.com/rememberlenny","followers_url":"https://api.github.com/users/rememberlenny/followers","following_url":"https://api.github.com/users/rememberlenny/following{/other_user}","gists_url":"https://api.github.com/users/rememberlenny/gists{/gist_id}","starred_url":"https://api.github.com/users/rememberlenny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rememberlenny/subscriptions","organizations_url":"https://api.github.com/users/rememberlenny/orgs","repos_url":"https://api.github.com/users/rememberlenny/repos","events_url":"https://api.github.com/users/rememberlenny/events{/privacy}","received_events_url":"https://api.github.com/users/rememberlenny/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/18F/C2/pulls/936/commits","review_comments_url":"https://api.github.com/repos/18F/C2/pulls/936/comments","review_comment_url":"https://api.github.com/repos/18F/C2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/18F/C2/issues/936/comments","statuses_url":"https://api.github.com/repos/18F/C2/statuses/7523c98d6397b07698ad0abd58712c0a9e28f10a","head":{"label":"18F:isolate-tracking","ref":"isolate-tracking","sha":"7523c98d6397b07698ad0abd58712c0a9e28f10a","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":18201810,"name":"C2","full_name":"18F/C2","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/C2","description":"an approval process automation tool","fork":false,"url":"https://api.github.com/repos/18F/C2","forks_url":"https://api.github.com/repos/18F/C2/forks","keys_url":"https://api.github.com/repos/18F/C2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/C2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/C2/teams","hooks_url":"https://api.github.com/repos/18F/C2/hooks","issue_events_url":"https://api.github.com/repos/18F/C2/issues/events{/number}","events_url":"https://api.github.com/repos/18F/C2/events","assignees_url":"https://api.github.com/repos/18F/C2/assignees{/user}","branches_url":"https://api.github.com/repos/18F/C2/branches{/branch}","tags_url":"https://api.github.com/repos/18F/C2/tags","blobs_url":"https://api.github.com/repos/18F/C2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/C2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/C2/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/C2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/C2/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/C2/languages","stargazers_url":"https://api.github.com/repos/18F/C2/stargazers","contributors_url":"https://api.github.com/repos/18F/C2/contributors","subscribers_url":"https://api.github.com/repos/18F/C2/subscribers","subscription_url":"https://api.github.com/repos/18F/C2/subscription","commits_url":"https://api.github.com/repos/18F/C2/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/C2/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/C2/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/C2/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/C2/contents/{+path}","compare_url":"https://api.github.com/repos/18F/C2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/C2/merges","archive_url":"https://api.github.com/repos/18F/C2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/C2/downloads","issues_url":"https://api.github.com/repos/18F/C2/issues{/number}","pulls_url":"https://api.github.com/repos/18F/C2/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/C2/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/C2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/C2/labels{/name}","releases_url":"https://api.github.com/repos/18F/C2/releases{/id}","deployments_url":"https://api.github.com/repos/18F/C2/deployments","created_at":"2014-03-28T05:15:23Z","updated_at":"2016-01-30T10:45:20Z","pushed_at":"2016-02-12T19:42:24Z","git_url":"git://github.com/18F/C2.git","ssh_url":"git@github.com:18F/C2.git","clone_url":"https://github.com/18F/C2.git","svn_url":"https://github.com/18F/C2","homepage":"https://cap.18f.gov","size":82296,"stargazers_count":39,"watchers_count":39,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":7,"forks":22,"open_issues":7,"watchers":39,"default_branch":"master"}},"base":{"label":"18F:master","ref":"master","sha":"9f71d90c2bd9c9ee091511953f69683cd7a38fe6","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":18201810,"name":"C2","full_name":"18F/C2","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/C2","description":"an approval process automation tool","fork":false,"url":"https://api.github.com/repos/18F/C2","forks_url":"https://api.github.com/repos/18F/C2/forks","keys_url":"https://api.github.com/repos/18F/C2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/C2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/C2/teams","hooks_url":"https://api.github.com/repos/18F/C2/hooks","issue_events_url":"https://api.github.com/repos/18F/C2/issues/events{/number}","events_url":"https://api.github.com/repos/18F/C2/events","assignees_url":"https://api.github.com/repos/18F/C2/assignees{/user}","branches_url":"https://api.github.com/repos/18F/C2/branches{/branch}","tags_url":"https://api.github.com/repos/18F/C2/tags","blobs_url":"https://api.github.com/repos/18F/C2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/C2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/C2/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/C2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/C2/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/C2/languages","stargazers_url":"https://api.github.com/repos/18F/C2/stargazers","contributors_url":"https://api.github.com/repos/18F/C2/contributors","subscribers_url":"https://api.github.com/repos/18F/C2/subscribers","subscription_url":"https://api.github.com/repos/18F/C2/subscription","commits_url":"https://api.github.com/repos/18F/C2/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/C2/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/C2/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/C2/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/C2/contents/{+path}","compare_url":"https://api.github.com/repos/18F/C2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/C2/merges","archive_url":"https://api.github.com/repos/18F/C2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/C2/downloads","issues_url":"https://api.github.com/repos/18F/C2/issues{/number}","pulls_url":"https://api.github.com/repos/18F/C2/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/C2/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/C2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/C2/labels{/name}","releases_url":"https://api.github.com/repos/18F/C2/releases{/id}","deployments_url":"https://api.github.com/repos/18F/C2/deployments","created_at":"2014-03-28T05:15:23Z","updated_at":"2016-01-30T10:45:20Z","pushed_at":"2016-02-12T19:42:24Z","git_url":"git://github.com/18F/C2.git","ssh_url":"git@github.com:18F/C2.git","clone_url":"https://github.com/18F/C2.git","svn_url":"https://github.com/18F/C2","homepage":"https://cap.18f.gov","size":82296,"stargazers_count":39,"watchers_count":39,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":7,"forks":22,"open_issues":7,"watchers":39,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/18F/C2/pulls/936"},"html":{"href":"https://github.com/18F/C2/pull/936"},"issue":{"href":"https://api.github.com/repos/18F/C2/issues/936"},"comments":{"href":"https://api.github.com/repos/18F/C2/issues/936/comments"},"review_comments":{"href":"https://api.github.com/repos/18F/C2/pulls/936/comments"},"review_comment":{"href":"https://api.github.com/repos/18F/C2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/18F/C2/pulls/936/commits"},"statuses":{"href":"https://api.github.com/repos/18F/C2/statuses/7523c98d6397b07698ad0abd58712c0a9e28f10a"}}}}