{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fels_212/pulls/comments/89562759","pull_request_review_id":10108229,"id":89562759,"diff_hunk":"@@ -42,4 +46,16 @@ def find_lesson\n   def lesson_params\n     params.require(:lesson).permit :id, results_attributes: [:answer_id, :id]\n   end\n+\n+  def create_activity user_id, target_id\n+    Activity.create action_type: Activity.types[:finished_lesson],\n+      user_id: user_id, target_id: target_id\n+  end\n+\n+  def authorize_view_permission\n+    unless current_user.id == @lesson.user_id || current_user.is_admin?","path":"app/controllers/lessons_controller.rb","position":31,"original_position":31,"commit_id":"13f434ecbcdd4756ad6762d9581f801c8f3a987b","original_commit_id":"13f434ecbcdd4756ad6762d9581f801c8f3a987b","user":{"login":"hellovietnam93","id":8023606,"avatar_url":"https://avatars.githubusercontent.com/u/8023606?v=3","gravatar_id":"","url":"https://api.github.com/users/hellovietnam93","html_url":"https://github.com/hellovietnam93","followers_url":"https://api.github.com/users/hellovietnam93/followers","following_url":"https://api.github.com/users/hellovietnam93/following{/other_user}","gists_url":"https://api.github.com/users/hellovietnam93/gists{/gist_id}","starred_url":"https://api.github.com/users/hellovietnam93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellovietnam93/subscriptions","organizations_url":"https://api.github.com/users/hellovietnam93/orgs","repos_url":"https://api.github.com/users/hellovietnam93/repos","events_url":"https://api.github.com/users/hellovietnam93/events{/privacy}","received_events_url":"https://api.github.com/users/hellovietnam93/received_events","type":"User","site_admin":false},"body":"xem ở side của admin chứ. tách biệt ra mà em","created_at":"2016-11-25T04:03:44Z","updated_at":"2016-11-25T04:03:51Z","html_url":"https://github.com/framgia/fels_212/pull/19#discussion_r89562759","pull_request_url":"https://api.github.com/repos/framgia/fels_212/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_212/pulls/comments/89562759"},"html":{"href":"https://github.com/framgia/fels_212/pull/19#discussion_r89562759"},"pull_request":{"href":"https://api.github.com/repos/framgia/fels_212/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fels_212/pulls/19","id":95245050,"html_url":"https://github.com/framgia/fels_212/pull/19","diff_url":"https://github.com/framgia/fels_212/pull/19.diff","patch_url":"https://github.com/framgia/fels_212/pull/19.patch","issue_url":"https://api.github.com/repos/framgia/fels_212/issues/19","number":19,"state":"open","locked":false,"title":"view result and user activities","user":{"login":"habt42","id":18291366,"avatar_url":"https://avatars.githubusercontent.com/u/18291366?v=3","gravatar_id":"","url":"https://api.github.com/users/habt42","html_url":"https://github.com/habt42","followers_url":"https://api.github.com/users/habt42/followers","following_url":"https://api.github.com/users/habt42/following{/other_user}","gists_url":"https://api.github.com/users/habt42/gists{/gist_id}","starred_url":"https://api.github.com/users/habt42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habt42/subscriptions","organizations_url":"https://api.github.com/users/habt42/orgs","repos_url":"https://api.github.com/users/habt42/repos","events_url":"https://api.github.com/users/habt42/events{/privacy}","received_events_url":"https://api.github.com/users/habt42/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-25T03:11:39Z","updated_at":"2016-11-25T04:03:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f5519999c0e224d87810d508ee1815cd26e6baed","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fels_212/pulls/19/commits","review_comments_url":"https://api.github.com/repos/framgia/fels_212/pulls/19/comments","review_comment_url":"https://api.github.com/repos/framgia/fels_212/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/fels_212/issues/19/comments","statuses_url":"https://api.github.com/repos/framgia/fels_212/statuses/13f434ecbcdd4756ad6762d9581f801c8f3a987b","head":{"label":"habt42:view-result","ref":"view-result","sha":"13f434ecbcdd4756ad6762d9581f801c8f3a987b","user":{"login":"habt42","id":18291366,"avatar_url":"https://avatars.githubusercontent.com/u/18291366?v=3","gravatar_id":"","url":"https://api.github.com/users/habt42","html_url":"https://github.com/habt42","followers_url":"https://api.github.com/users/habt42/followers","following_url":"https://api.github.com/users/habt42/following{/other_user}","gists_url":"https://api.github.com/users/habt42/gists{/gist_id}","starred_url":"https://api.github.com/users/habt42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habt42/subscriptions","organizations_url":"https://api.github.com/users/habt42/orgs","repos_url":"https://api.github.com/users/habt42/repos","events_url":"https://api.github.com/users/habt42/events{/privacy}","received_events_url":"https://api.github.com/users/habt42/received_events","type":"User","site_admin":false},"repo":{"id":73683701,"name":"fels_212","full_name":"habt42/fels_212","owner":{"login":"habt42","id":18291366,"avatar_url":"https://avatars.githubusercontent.com/u/18291366?v=3","gravatar_id":"","url":"https://api.github.com/users/habt42","html_url":"https://github.com/habt42","followers_url":"https://api.github.com/users/habt42/followers","following_url":"https://api.github.com/users/habt42/following{/other_user}","gists_url":"https://api.github.com/users/habt42/gists{/gist_id}","starred_url":"https://api.github.com/users/habt42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habt42/subscriptions","organizations_url":"https://api.github.com/users/habt42/orgs","repos_url":"https://api.github.com/users/habt42/repos","events_url":"https://api.github.com/users/habt42/events{/privacy}","received_events_url":"https://api.github.com/users/habt42/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/habt42/fels_212","description":"Framgia E-Learning System (training)","fork":true,"url":"https://api.github.com/repos/habt42/fels_212","forks_url":"https://api.github.com/repos/habt42/fels_212/forks","keys_url":"https://api.github.com/repos/habt42/fels_212/keys{/key_id}","collaborators_url":"https://api.github.com/repos/habt42/fels_212/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/habt42/fels_212/teams","hooks_url":"https://api.github.com/repos/habt42/fels_212/hooks","issue_events_url":"https://api.github.com/repos/habt42/fels_212/issues/events{/number}","events_url":"https://api.github.com/repos/habt42/fels_212/events","assignees_url":"https://api.github.com/repos/habt42/fels_212/assignees{/user}","branches_url":"https://api.github.com/repos/habt42/fels_212/branches{/branch}","tags_url":"https://api.github.com/repos/habt42/fels_212/tags","blobs_url":"https://api.github.com/repos/habt42/fels_212/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/habt42/fels_212/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/habt42/fels_212/git/refs{/sha}","trees_url":"https://api.github.com/repos/habt42/fels_212/git/trees{/sha}","statuses_url":"https://api.github.com/repos/habt42/fels_212/statuses/{sha}","languages_url":"https://api.github.com/repos/habt42/fels_212/languages","stargazers_url":"https://api.github.com/repos/habt42/fels_212/stargazers","contributors_url":"https://api.github.com/repos/habt42/fels_212/contributors","subscribers_url":"https://api.github.com/repos/habt42/fels_212/subscribers","subscription_url":"https://api.github.com/repos/habt42/fels_212/subscription","commits_url":"https://api.github.com/repos/habt42/fels_212/commits{/sha}","git_commits_url":"https://api.github.com/repos/habt42/fels_212/git/commits{/sha}","comments_url":"https://api.github.com/repos/habt42/fels_212/comments{/number}","issue_comment_url":"https://api.github.com/repos/habt42/fels_212/issues/comments{/number}","contents_url":"https://api.github.com/repos/habt42/fels_212/contents/{+path}","compare_url":"https://api.github.com/repos/habt42/fels_212/compare/{base}...{head}","merges_url":"https://api.github.com/repos/habt42/fels_212/merges","archive_url":"https://api.github.com/repos/habt42/fels_212/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/habt42/fels_212/downloads","issues_url":"https://api.github.com/repos/habt42/fels_212/issues{/number}","pulls_url":"https://api.github.com/repos/habt42/fels_212/pulls{/number}","milestones_url":"https://api.github.com/repos/habt42/fels_212/milestones{/number}","notifications_url":"https://api.github.com/repos/habt42/fels_212/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/habt42/fels_212/labels{/name}","releases_url":"https://api.github.com/repos/habt42/fels_212/releases{/id}","deployments_url":"https://api.github.com/repos/habt42/fels_212/deployments","created_at":"2016-11-14T08:33:00Z","updated_at":"2016-11-14T01:28:05Z","pushed_at":"2016-11-25T03:11:11Z","git_url":"git://github.com/habt42/fels_212.git","ssh_url":"git@github.com:habt42/fels_212.git","clone_url":"https://github.com/habt42/fels_212.git","svn_url":"https://github.com/habt42/fels_212","homepage":null,"size":89,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"framgia:develop","ref":"develop","sha":"4a96ce60ed0d494632a5d7a1de5b09da6ce1ff58","user":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"repo":{"id":73655419,"name":"fels_212","full_name":"framgia/fels_212","owner":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/framgia/fels_212","description":"Framgia E-Learning System (training)","fork":false,"url":"https://api.github.com/repos/framgia/fels_212","forks_url":"https://api.github.com/repos/framgia/fels_212/forks","keys_url":"https://api.github.com/repos/framgia/fels_212/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fels_212/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fels_212/teams","hooks_url":"https://api.github.com/repos/framgia/fels_212/hooks","issue_events_url":"https://api.github.com/repos/framgia/fels_212/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fels_212/events","assignees_url":"https://api.github.com/repos/framgia/fels_212/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fels_212/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fels_212/tags","blobs_url":"https://api.github.com/repos/framgia/fels_212/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fels_212/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fels_212/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fels_212/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fels_212/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fels_212/languages","stargazers_url":"https://api.github.com/repos/framgia/fels_212/stargazers","contributors_url":"https://api.github.com/repos/framgia/fels_212/contributors","subscribers_url":"https://api.github.com/repos/framgia/fels_212/subscribers","subscription_url":"https://api.github.com/repos/framgia/fels_212/subscription","commits_url":"https://api.github.com/repos/framgia/fels_212/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fels_212/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fels_212/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fels_212/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/fels_212/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fels_212/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fels_212/merges","archive_url":"https://api.github.com/repos/framgia/fels_212/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fels_212/downloads","issues_url":"https://api.github.com/repos/framgia/fels_212/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fels_212/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fels_212/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fels_212/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fels_212/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fels_212/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/fels_212/deployments","created_at":"2016-11-14T01:28:05Z","updated_at":"2016-11-14T01:28:05Z","pushed_at":"2016-11-25T03:11:39Z","git_url":"git://github.com/framgia/fels_212.git","ssh_url":"git@github.com:framgia/fels_212.git","clone_url":"https://github.com/framgia/fels_212.git","svn_url":"https://github.com/framgia/fels_212","homepage":null,"size":84,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_212/pulls/19"},"html":{"href":"https://github.com/framgia/fels_212/pull/19"},"issue":{"href":"https://api.github.com/repos/framgia/fels_212/issues/19"},"comments":{"href":"https://api.github.com/repos/framgia/fels_212/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fels_212/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fels_212/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/fels_212/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fels_212/statuses/13f434ecbcdd4756ad6762d9581f801c8f3a987b"}}}}
{"actor":{"display_login":"hellovietnam93"}}