{"action":"created","comment":{"url":"https://api.github.com/repos/Coursemology/coursemology2/pulls/comments/243733614","pull_request_review_id":187588648,"id":243733614,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MzczMzYxNA==","diff_hunk":"@@ -6,15 +6,21 @@ class Course::Video::Submission < ApplicationRecord\n \n   acts_as_experience_points_record\n \n+  after_save :init_statistic\n+\n   validate :validate_consistent_user, :validate_unique_submission, on: :create\n   validates :creator, presence: true\n   validates :updater, presence: true\n   validates :video, presence: true\n \n   belongs_to :video, inverse_of: :submissions\n \n-  has_many :sessions, inverse_of: :submission, dependent: :destroy\n-  has_many :events, through: :sessions\n+  has_many :sessions, class_name: Course::Video::Session.name,\n+                      inverse_of: :submission, dependent: :destroy\n+  has_many :events, through: :sessions, class_name: Course::Video::Event.name\n+  has_one :statistic, class_name: Course::Video::Submission::Statistic.name,\n+                      inverse_of: :submission, dependent: :destroy, autosave: true,\n+                      dependent: :destroy","path":"app/models/course/video/submission.rb","position":20,"original_position":20,"commit_id":"0339aa9188f7eefb8c4943b1e7fb2eeb5c60e9bf","original_commit_id":"0339aa9188f7eefb8c4943b1e7fb2eeb5c60e9bf","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","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":"Lint/DuplicatedKey: Duplicated key in hash literal.","created_at":"2018-12-22T10:57:28Z","updated_at":"2018-12-22T10:57:28Z","html_url":"https://github.com/Coursemology/coursemology2/pull/3260#discussion_r243733614","pull_request_url":"https://api.github.com/repos/Coursemology/coursemology2/pulls/3260","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Coursemology/coursemology2/pulls/comments/243733614"},"html":{"href":"https://github.com/Coursemology/coursemology2/pull/3260#discussion_r243733614"},"pull_request":{"href":"https://api.github.com/repos/Coursemology/coursemology2/pulls/3260"}}},"pull_request":{"url":"https://api.github.com/repos/Coursemology/coursemology2/pulls/3260","id":240198461,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwMTk4NDYx","html_url":"https://github.com/Coursemology/coursemology2/pull/3260","diff_url":"https://github.com/Coursemology/coursemology2/pull/3260.diff","patch_url":"https://github.com/Coursemology/coursemology2/pull/3260.patch","issue_url":"https://api.github.com/repos/Coursemology/coursemology2/issues/3260","number":3260,"state":"open","locked":false,"title":"Implement statistic cache","user":{"login":"trangmei","id":35135264,"node_id":"MDQ6VXNlcjM1MTM1MjY0","avatar_url":"https://avatars1.githubusercontent.com/u/35135264?v=4","gravatar_id":"","url":"https://api.github.com/users/trangmei","html_url":"https://github.com/trangmei","followers_url":"https://api.github.com/users/trangmei/followers","following_url":"https://api.github.com/users/trangmei/following{/other_user}","gists_url":"https://api.github.com/users/trangmei/gists{/gist_id}","starred_url":"https://api.github.com/users/trangmei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trangmei/subscriptions","organizations_url":"https://api.github.com/users/trangmei/orgs","repos_url":"https://api.github.com/users/trangmei/repos","events_url":"https://api.github.com/users/trangmei/events{/privacy}","received_events_url":"https://api.github.com/users/trangmei/received_events","type":"User","site_admin":false},"body":"Fixes https://github.com/Coursemology/coursemology2/issues/3222\r\n\r\nBlocked by https://github.com/Coursemology/coursemology2/pull/3242","created_at":"2018-12-20T14:57:52Z","updated_at":"2018-12-22T10:57:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74a803aa849cb3946c54156f1ee19f011b509983","assignee":{"login":"trangmei","id":35135264,"node_id":"MDQ6VXNlcjM1MTM1MjY0","avatar_url":"https://avatars1.githubusercontent.com/u/35135264?v=4","gravatar_id":"","url":"https://api.github.com/users/trangmei","html_url":"https://github.com/trangmei","followers_url":"https://api.github.com/users/trangmei/followers","following_url":"https://api.github.com/users/trangmei/following{/other_user}","gists_url":"https://api.github.com/users/trangmei/gists{/gist_id}","starred_url":"https://api.github.com/users/trangmei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trangmei/subscriptions","organizations_url":"https://api.github.com/users/trangmei/orgs","repos_url":"https://api.github.com/users/trangmei/repos","events_url":"https://api.github.com/users/trangmei/events{/privacy}","received_events_url":"https://api.github.com/users/trangmei/received_events","type":"User","site_admin":false},"assignees":[{"login":"trangmei","id":35135264,"node_id":"MDQ6VXNlcjM1MTM1MjY0","avatar_url":"https://avatars1.githubusercontent.com/u/35135264?v=4","gravatar_id":"","url":"https://api.github.com/users/trangmei","html_url":"https://github.com/trangmei","followers_url":"https://api.github.com/users/trangmei/followers","following_url":"https://api.github.com/users/trangmei/following{/other_user}","gists_url":"https://api.github.com/users/trangmei/gists{/gist_id}","starred_url":"https://api.github.com/users/trangmei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trangmei/subscriptions","organizations_url":"https://api.github.com/users/trangmei/orgs","repos_url":"https://api.github.com/users/trangmei/repos","events_url":"https://api.github.com/users/trangmei/events{/privacy}","received_events_url":"https://api.github.com/users/trangmei/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":166000184,"node_id":"MDU6TGFiZWwxNjYwMDAxODQ=","url":"https://api.github.com/repos/Coursemology/coursemology2/labels/blocked","name":"blocked","color":"800000","default":false},{"id":428708484,"node_id":"MDU6TGFiZWw0Mjg3MDg0ODQ=","url":"https://api.github.com/repos/Coursemology/coursemology2/labels/needs%20review","name":"needs review","color":"e6e6e6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Coursemology/coursemology2/pulls/3260/commits","review_comments_url":"https://api.github.com/repos/Coursemology/coursemology2/pulls/3260/comments","review_comment_url":"https://api.github.com/repos/Coursemology/coursemology2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Coursemology/coursemology2/issues/3260/comments","statuses_url":"https://api.github.com/repos/Coursemology/coursemology2/statuses/0339aa9188f7eefb8c4943b1e7fb2eeb5c60e9bf","head":{"label":"coursemology-collab:trang/statistic-per-video","ref":"trang/statistic-per-video","sha":"0339aa9188f7eefb8c4943b1e7fb2eeb5c60e9bf","user":{"login":"coursemology-collab","id":8666458,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg2NjY0NTg=","avatar_url":"https://avatars1.githubusercontent.com/u/8666458?v=4","gravatar_id":"","url":"https://api.github.com/users/coursemology-collab","html_url":"https://github.com/coursemology-collab","followers_url":"https://api.github.com/users/coursemology-collab/followers","following_url":"https://api.github.com/users/coursemology-collab/following{/other_user}","gists_url":"https://api.github.com/users/coursemology-collab/gists{/gist_id}","starred_url":"https://api.github.com/users/coursemology-collab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coursemology-collab/subscriptions","organizations_url":"https://api.github.com/users/coursemology-collab/orgs","repos_url":"https://api.github.com/users/coursemology-collab/repos","events_url":"https://api.github.com/users/coursemology-collab/events{/privacy}","received_events_url":"https://api.github.com/users/coursemology-collab/received_events","type":"Organization","site_admin":false},"repo":{"id":23697674,"node_id":"MDEwOlJlcG9zaXRvcnkyMzY5NzY3NA==","name":"coursemology2","full_name":"coursemology-collab/coursemology2","private":false,"owner":{"login":"coursemology-collab","id":8666458,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg2NjY0NTg=","avatar_url":"https://avatars1.githubusercontent.com/u/8666458?v=4","gravatar_id":"","url":"https://api.github.com/users/coursemology-collab","html_url":"https://github.com/coursemology-collab","followers_url":"https://api.github.com/users/coursemology-collab/followers","following_url":"https://api.github.com/users/coursemology-collab/following{/other_user}","gists_url":"https://api.github.com/users/coursemology-collab/gists{/gist_id}","starred_url":"https://api.github.com/users/coursemology-collab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coursemology-collab/subscriptions","organizations_url":"https://api.github.com/users/coursemology-collab/orgs","repos_url":"https://api.github.com/users/coursemology-collab/repos","events_url":"https://api.github.com/users/coursemology-collab/events{/privacy}","received_events_url":"https://api.github.com/users/coursemology-collab/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/coursemology-collab/coursemology2","description":"Rails 5 re-write of Coursemology","fork":true,"url":"https://api.github.com/repos/coursemology-collab/coursemology2","forks_url":"https://api.github.com/repos/coursemology-collab/coursemology2/forks","keys_url":"https://api.github.com/repos/coursemology-collab/coursemology2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coursemology-collab/coursemology2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coursemology-collab/coursemology2/teams","hooks_url":"https://api.github.com/repos/coursemology-collab/coursemology2/hooks","issue_events_url":"https://api.github.com/repos/coursemology-collab/coursemology2/issues/events{/number}","events_url":"https://api.github.com/repos/coursemology-collab/coursemology2/events","assignees_url":"https://api.github.com/repos/coursemology-collab/coursemology2/assignees{/user}","branches_url":"https://api.github.com/repos/coursemology-collab/coursemology2/branches{/branch}","tags_url":"https://api.github.com/repos/coursemology-collab/coursemology2/tags","blobs_url":"https://api.github.com/repos/coursemology-collab/coursemology2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coursemology-collab/coursemology2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coursemology-collab/coursemology2/git/refs{/sha}","trees_url":"https://api.github.com/repos/coursemology-collab/coursemology2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coursemology-collab/coursemology2/statuses/{sha}","languages_url":"https://api.github.com/repos/coursemology-collab/coursemology2/languages","stargazers_url":"https://api.github.com/repos/coursemology-collab/coursemology2/stargazers","contributors_url":"https://api.github.com/repos/coursemology-collab/coursemology2/contributors","subscribers_url":"https://api.github.com/repos/coursemology-collab/coursemology2/subscribers","subscription_url":"https://api.github.com/repos/coursemology-collab/coursemology2/subscription","commits_url":"https://api.github.com/repos/coursemology-collab/coursemology2/commits{/sha}","git_commits_url":"https://api.github.com/repos/coursemology-collab/coursemology2/git/commits{/sha}","comments_url":"https://api.github.com/repos/coursemology-collab/coursemology2/comments{/number}","issue_comment_url":"https://api.github.com/repos/coursemology-collab/coursemology2/issues/comments{/number}","contents_url":"https://api.github.com/repos/coursemology-collab/coursemology2/contents/{+path}","compare_url":"https://api.github.com/repos/coursemology-collab/coursemology2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coursemology-collab/coursemology2/merges","archive_url":"https://api.github.com/repos/coursemology-collab/coursemology2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coursemology-collab/coursemology2/downloads","issues_url":"https://api.github.com/repos/coursemology-collab/coursemology2/issues{/number}","pulls_url":"https://api.github.com/repos/coursemology-collab/coursemology2/pulls{/number}","milestones_url":"https://api.github.com/repos/coursemology-collab/coursemology2/milestones{/number}","notifications_url":"https://api.github.com/repos/coursemology-collab/coursemology2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coursemology-collab/coursemology2/labels{/name}","releases_url":"https://api.github.com/repos/coursemology-collab/coursemology2/releases{/id}","deployments_url":"https://api.github.com/repos/coursemology-collab/coursemology2/deployments","created_at":"2014-09-05T09:32:07Z","updated_at":"2018-12-20T07:26:51Z","pushed_at":"2018-12-22T10:57:15Z","git_url":"git://github.com/coursemology-collab/coursemology2.git","ssh_url":"git@github.com:coursemology-collab/coursemology2.git","clone_url":"https://github.com/coursemology-collab/coursemology2.git","svn_url":"https://github.com/coursemology-collab/coursemology2","homepage":"","size":13181,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"Coursemology:master","ref":"master","sha":"74db141563aa4c040554c0efae047c585b093220","user":{"login":"Coursemology","id":4427741,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0Mjc3NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/4427741?v=4","gravatar_id":"","url":"https://api.github.com/users/Coursemology","html_url":"https://github.com/Coursemology","followers_url":"https://api.github.com/users/Coursemology/followers","following_url":"https://api.github.com/users/Coursemology/following{/other_user}","gists_url":"https://api.github.com/users/Coursemology/gists{/gist_id}","starred_url":"https://api.github.com/users/Coursemology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Coursemology/subscriptions","organizations_url":"https://api.github.com/users/Coursemology/orgs","repos_url":"https://api.github.com/users/Coursemology/repos","events_url":"https://api.github.com/users/Coursemology/events{/privacy}","received_events_url":"https://api.github.com/users/Coursemology/received_events","type":"Organization","site_admin":false},"repo":{"id":22155032,"node_id":"MDEwOlJlcG9zaXRvcnkyMjE1NTAzMg==","name":"coursemology2","full_name":"Coursemology/coursemology2","private":false,"owner":{"login":"Coursemology","id":4427741,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0Mjc3NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/4427741?v=4","gravatar_id":"","url":"https://api.github.com/users/Coursemology","html_url":"https://github.com/Coursemology","followers_url":"https://api.github.com/users/Coursemology/followers","following_url":"https://api.github.com/users/Coursemology/following{/other_user}","gists_url":"https://api.github.com/users/Coursemology/gists{/gist_id}","starred_url":"https://api.github.com/users/Coursemology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Coursemology/subscriptions","organizations_url":"https://api.github.com/users/Coursemology/orgs","repos_url":"https://api.github.com/users/Coursemology/repos","events_url":"https://api.github.com/users/Coursemology/events{/privacy}","received_events_url":"https://api.github.com/users/Coursemology/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Coursemology/coursemology2","description":"Rails 5 re-write of Coursemology","fork":false,"url":"https://api.github.com/repos/Coursemology/coursemology2","forks_url":"https://api.github.com/repos/Coursemology/coursemology2/forks","keys_url":"https://api.github.com/repos/Coursemology/coursemology2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Coursemology/coursemology2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Coursemology/coursemology2/teams","hooks_url":"https://api.github.com/repos/Coursemology/coursemology2/hooks","issue_events_url":"https://api.github.com/repos/Coursemology/coursemology2/issues/events{/number}","events_url":"https://api.github.com/repos/Coursemology/coursemology2/events","assignees_url":"https://api.github.com/repos/Coursemology/coursemology2/assignees{/user}","branches_url":"https://api.github.com/repos/Coursemology/coursemology2/branches{/branch}","tags_url":"https://api.github.com/repos/Coursemology/coursemology2/tags","blobs_url":"https://api.github.com/repos/Coursemology/coursemology2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Coursemology/coursemology2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Coursemology/coursemology2/git/refs{/sha}","trees_url":"https://api.github.com/repos/Coursemology/coursemology2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Coursemology/coursemology2/statuses/{sha}","languages_url":"https://api.github.com/repos/Coursemology/coursemology2/languages","stargazers_url":"https://api.github.com/repos/Coursemology/coursemology2/stargazers","contributors_url":"https://api.github.com/repos/Coursemology/coursemology2/contributors","subscribers_url":"https://api.github.com/repos/Coursemology/coursemology2/subscribers","subscription_url":"https://api.github.com/repos/Coursemology/coursemology2/subscription","commits_url":"https://api.github.com/repos/Coursemology/coursemology2/commits{/sha}","git_commits_url":"https://api.github.com/repos/Coursemology/coursemology2/git/commits{/sha}","comments_url":"https://api.github.com/repos/Coursemology/coursemology2/comments{/number}","issue_comment_url":"https://api.github.com/repos/Coursemology/coursemology2/issues/comments{/number}","contents_url":"https://api.github.com/repos/Coursemology/coursemology2/contents/{+path}","compare_url":"https://api.github.com/repos/Coursemology/coursemology2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Coursemology/coursemology2/merges","archive_url":"https://api.github.com/repos/Coursemology/coursemology2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Coursemology/coursemology2/downloads","issues_url":"https://api.github.com/repos/Coursemology/coursemology2/issues{/number}","pulls_url":"https://api.github.com/repos/Coursemology/coursemology2/pulls{/number}","milestones_url":"https://api.github.com/repos/Coursemology/coursemology2/milestones{/number}","notifications_url":"https://api.github.com/repos/Coursemology/coursemology2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Coursemology/coursemology2/labels{/name}","releases_url":"https://api.github.com/repos/Coursemology/coursemology2/releases{/id}","deployments_url":"https://api.github.com/repos/Coursemology/coursemology2/deployments","created_at":"2014-07-23T14:57:06Z","updated_at":"2018-12-22T03:19:04Z","pushed_at":"2018-12-22T10:57:17Z","git_url":"git://github.com/Coursemology/coursemology2.git","ssh_url":"git@github.com:Coursemology/coursemology2.git","clone_url":"https://github.com/Coursemology/coursemology2.git","svn_url":"https://github.com/Coursemology/coursemology2","homepage":"https://coursemology.org","size":12967,"stargazers_count":61,"watchers_count":61,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":50,"mirror_url":null,"archived":false,"open_issues_count":209,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":50,"open_issues":209,"watchers":61,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Coursemology/coursemology2/pulls/3260"},"html":{"href":"https://github.com/Coursemology/coursemology2/pull/3260"},"issue":{"href":"https://api.github.com/repos/Coursemology/coursemology2/issues/3260"},"comments":{"href":"https://api.github.com/repos/Coursemology/coursemology2/issues/3260/comments"},"review_comments":{"href":"https://api.github.com/repos/Coursemology/coursemology2/pulls/3260/comments"},"review_comment":{"href":"https://api.github.com/repos/Coursemology/coursemology2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Coursemology/coursemology2/pulls/3260/commits"},"statuses":{"href":"https://api.github.com/repos/Coursemology/coursemology2/statuses/0339aa9188f7eefb8c4943b1e7fb2eeb5c60e9bf"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"houndci-bot"}}