{"action":"created","comment":{"url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/pulls/comments/30062903","id":30062903,"diff_hunk":"@@ -0,0 +1,43 @@\n+# User click data from device\n+class ClickEvent < ActiveRecord::Base\n+  belongs_to :category\n+  belongs_to :chapter\n+  belongs_to :page\n+\n+  validates :coordinate_x, :coordinate_y, :current_path,\n+            :clicked_at, :uuid, :tag_name, :event_type,\n+            :category, :chapter, :page,\n+            presence: true\n+\n+  # rubocop:disable Metrics/MethodLength\n+  def self.deserialize(event_clicks)\n+    event_clicks.each_with_object([]) do |click, array|\n+      array << {\n+        coordinate_x: click[\"coordinateX\"],\n+        coordinate_y: click[\"coordinateY\"],\n+        current_path: click[\"currentPath\"],\n+        clicked_at: (DateTime.parse(click[\"clickedAt\"]) if click[\"clickedAt\"]),\n+        uuid: click[\"uuid\"],\n+        image_src: click[\"imageSrc\"],\n+        tag_name: click[\"tagName\"],\n+        text_context: click[\"textContext\"],\n+        event_type: click[\"eventType\"],\n+        category_id: click[\"categoryId\"].to_i,\n+        chapter_id: click[\"chapterId\"].to_i,\n+        page_id: click[\"pageId\"].to_i\n+      }\n+    end\n+  end\n+  # rubocop:enable Metrics/MethodLength\n+\n+  def self.save_all(data)","path":"app/models/click_event.rb","position":33,"original_position":33,"commit_id":"5c301373e7a6ed9c1d877f0638e3b93a0ecb889f","original_commit_id":"5c301373e7a6ed9c1d877f0638e3b93a0ecb889f","user":{"login":"ericcf","id":58693,"avatar_url":"https://avatars.githubusercontent.com/u/58693?v=3","gravatar_id":"","url":"https://api.github.com/users/ericcf","html_url":"https://github.com/ericcf","followers_url":"https://api.github.com/users/ericcf/followers","following_url":"https://api.github.com/users/ericcf/following{/other_user}","gists_url":"https://api.github.com/users/ericcf/gists{/gist_id}","starred_url":"https://api.github.com/users/ericcf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericcf/subscriptions","organizations_url":"https://api.github.com/users/ericcf/orgs","repos_url":"https://api.github.com/users/ericcf/repos","events_url":"https://api.github.com/users/ericcf/events{/privacy}","received_events_url":"https://api.github.com/users/ericcf/received_events","type":"User","site_admin":false},"body":"You have to make that check in `deserialize`. Why won't my suggestion work for `save_all`?","created_at":"2015-05-11T17:44:50Z","updated_at":"2015-05-11T17:44:50Z","html_url":"https://github.com/cbitstech/ed_navigator_dashboard/pull/28#discussion_r30062903","pull_request_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/pulls/comments/30062903"},"html":{"href":"https://github.com/cbitstech/ed_navigator_dashboard/pull/28#discussion_r30062903"},"pull_request":{"href":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/pulls/28","id":35051192,"html_url":"https://github.com/cbitstech/ed_navigator_dashboard/pull/28","diff_url":"https://github.com/cbitstech/ed_navigator_dashboard/pull/28.diff","patch_url":"https://github.com/cbitstech/ed_navigator_dashboard/pull/28.patch","issue_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/issues/28","number":28,"state":"open","locked":false,"title":"Msw 92742452 authentication","user":{"login":"michaelwehrley","id":526136,"avatar_url":"https://avatars.githubusercontent.com/u/526136?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelwehrley","html_url":"https://github.com/michaelwehrley","followers_url":"https://api.github.com/users/michaelwehrley/followers","following_url":"https://api.github.com/users/michaelwehrley/following{/other_user}","gists_url":"https://api.github.com/users/michaelwehrley/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelwehrley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelwehrley/subscriptions","organizations_url":"https://api.github.com/users/michaelwehrley/orgs","repos_url":"https://api.github.com/users/michaelwehrley/repos","events_url":"https://api.github.com/users/michaelwehrley/events{/privacy}","received_events_url":"https://api.github.com/users/michaelwehrley/received_events","type":"User","site_admin":false},"body":"Allow Click Data to be Submitted\r\n\r\n* Add Client UUID Authentication\r\n* Add ClickEvent Model\r\n* Add Auth Model and Controller Specs","created_at":"2015-05-08T22:09:33Z","updated_at":"2015-05-11T17:44:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af076ccd67100162d6164a073a40f61d8811c6f3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/pulls/28/commits","review_comments_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/pulls/28/comments","review_comment_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/issues/28/comments","statuses_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/statuses/5c301373e7a6ed9c1d877f0638e3b93a0ecb889f","head":{"label":"cbitstech:msw_92742452_authentication","ref":"msw_92742452_authentication","sha":"5c301373e7a6ed9c1d877f0638e3b93a0ecb889f","user":{"login":"cbitstech","id":864362,"avatar_url":"https://avatars.githubusercontent.com/u/864362?v=3","gravatar_id":"","url":"https://api.github.com/users/cbitstech","html_url":"https://github.com/cbitstech","followers_url":"https://api.github.com/users/cbitstech/followers","following_url":"https://api.github.com/users/cbitstech/following{/other_user}","gists_url":"https://api.github.com/users/cbitstech/gists{/gist_id}","starred_url":"https://api.github.com/users/cbitstech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbitstech/subscriptions","organizations_url":"https://api.github.com/users/cbitstech/orgs","repos_url":"https://api.github.com/users/cbitstech/repos","events_url":"https://api.github.com/users/cbitstech/events{/privacy}","received_events_url":"https://api.github.com/users/cbitstech/received_events","type":"User","site_admin":false},"repo":{"id":33136744,"name":"ed_navigator_dashboard","full_name":"cbitstech/ed_navigator_dashboard","owner":{"login":"cbitstech","id":864362,"avatar_url":"https://avatars.githubusercontent.com/u/864362?v=3","gravatar_id":"","url":"https://api.github.com/users/cbitstech","html_url":"https://github.com/cbitstech","followers_url":"https://api.github.com/users/cbitstech/followers","following_url":"https://api.github.com/users/cbitstech/following{/other_user}","gists_url":"https://api.github.com/users/cbitstech/gists{/gist_id}","starred_url":"https://api.github.com/users/cbitstech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbitstech/subscriptions","organizations_url":"https://api.github.com/users/cbitstech/orgs","repos_url":"https://api.github.com/users/cbitstech/repos","events_url":"https://api.github.com/users/cbitstech/events{/privacy}","received_events_url":"https://api.github.com/users/cbitstech/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cbitstech/ed_navigator_dashboard","description":"","fork":false,"url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard","forks_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/forks","keys_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/teams","hooks_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/hooks","issue_events_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/issues/events{/number}","events_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/events","assignees_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/assignees{/user}","branches_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/branches{/branch}","tags_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/tags","blobs_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/statuses/{sha}","languages_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/languages","stargazers_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/stargazers","contributors_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/contributors","subscribers_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/subscribers","subscription_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/subscription","commits_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/issues/comments{/number}","contents_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/contents/{+path}","compare_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/merges","archive_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/downloads","issues_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/issues{/number}","pulls_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/pulls{/number}","milestones_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/milestones{/number}","notifications_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/labels{/name}","releases_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/releases{/id}","created_at":"2015-03-30T17:14:30Z","updated_at":"2015-05-07T16:45:07Z","pushed_at":"2015-05-08T22:10:56Z","git_url":"git://github.com/cbitstech/ed_navigator_dashboard.git","ssh_url":"git@github.com:cbitstech/ed_navigator_dashboard.git","clone_url":"https://github.com/cbitstech/ed_navigator_dashboard.git","svn_url":"https://github.com/cbitstech/ed_navigator_dashboard","homepage":null,"size":604,"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":"cbitstech:master","ref":"master","sha":"0d48738422b591192c49718fe7eee128c128bcfe","user":{"login":"cbitstech","id":864362,"avatar_url":"https://avatars.githubusercontent.com/u/864362?v=3","gravatar_id":"","url":"https://api.github.com/users/cbitstech","html_url":"https://github.com/cbitstech","followers_url":"https://api.github.com/users/cbitstech/followers","following_url":"https://api.github.com/users/cbitstech/following{/other_user}","gists_url":"https://api.github.com/users/cbitstech/gists{/gist_id}","starred_url":"https://api.github.com/users/cbitstech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbitstech/subscriptions","organizations_url":"https://api.github.com/users/cbitstech/orgs","repos_url":"https://api.github.com/users/cbitstech/repos","events_url":"https://api.github.com/users/cbitstech/events{/privacy}","received_events_url":"https://api.github.com/users/cbitstech/received_events","type":"User","site_admin":false},"repo":{"id":33136744,"name":"ed_navigator_dashboard","full_name":"cbitstech/ed_navigator_dashboard","owner":{"login":"cbitstech","id":864362,"avatar_url":"https://avatars.githubusercontent.com/u/864362?v=3","gravatar_id":"","url":"https://api.github.com/users/cbitstech","html_url":"https://github.com/cbitstech","followers_url":"https://api.github.com/users/cbitstech/followers","following_url":"https://api.github.com/users/cbitstech/following{/other_user}","gists_url":"https://api.github.com/users/cbitstech/gists{/gist_id}","starred_url":"https://api.github.com/users/cbitstech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbitstech/subscriptions","organizations_url":"https://api.github.com/users/cbitstech/orgs","repos_url":"https://api.github.com/users/cbitstech/repos","events_url":"https://api.github.com/users/cbitstech/events{/privacy}","received_events_url":"https://api.github.com/users/cbitstech/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cbitstech/ed_navigator_dashboard","description":"","fork":false,"url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard","forks_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/forks","keys_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/teams","hooks_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/hooks","issue_events_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/issues/events{/number}","events_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/events","assignees_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/assignees{/user}","branches_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/branches{/branch}","tags_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/tags","blobs_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/statuses/{sha}","languages_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/languages","stargazers_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/stargazers","contributors_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/contributors","subscribers_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/subscribers","subscription_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/subscription","commits_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/issues/comments{/number}","contents_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/contents/{+path}","compare_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/merges","archive_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/downloads","issues_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/issues{/number}","pulls_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/pulls{/number}","milestones_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/milestones{/number}","notifications_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/labels{/name}","releases_url":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/releases{/id}","created_at":"2015-03-30T17:14:30Z","updated_at":"2015-05-07T16:45:07Z","pushed_at":"2015-05-08T22:10:56Z","git_url":"git://github.com/cbitstech/ed_navigator_dashboard.git","ssh_url":"git@github.com:cbitstech/ed_navigator_dashboard.git","clone_url":"https://github.com/cbitstech/ed_navigator_dashboard.git","svn_url":"https://github.com/cbitstech/ed_navigator_dashboard","homepage":null,"size":604,"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/cbitstech/ed_navigator_dashboard/pulls/28"},"html":{"href":"https://github.com/cbitstech/ed_navigator_dashboard/pull/28"},"issue":{"href":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/issues/28"},"comments":{"href":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/cbitstech/ed_navigator_dashboard/statuses/5c301373e7a6ed9c1d877f0638e3b93a0ecb889f"}}}}