{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fels_36/pulls/comments/24640701","id":24640701,"diff_hunk":"@@ -0,0 +1,25 @@\n+class LessionsController < ApplicationController\n+  def new\n+  end\n+\n+  def create\n+    @category = Category.find params[:category]\n+    @lession = Lession.new(user: current_user, category: @category)\n+    @words = @category.words.sample(20)\n+    @words.each do |w|\n+      result = Result.new(word: w)\n+      @lession.results << result\n+    end\n+    if @lession.save\n+      redirect_to @lession\n+    else\n+      flash[:warning] = 'Can not create lessions, try again later!'","path":"app/controllers/lessions_controller.rb","position":16,"original_position":16,"commit_id":"317858d981c987384766d611778102edae61cfd4","original_commit_id":"317858d981c987384766d611778102edae61cfd4","user":{"login":"chuanhtuan","id":5590771,"avatar_url":"https://avatars.githubusercontent.com/u/5590771?v=3","gravatar_id":"","url":"https://api.github.com/users/chuanhtuan","html_url":"https://github.com/chuanhtuan","followers_url":"https://api.github.com/users/chuanhtuan/followers","following_url":"https://api.github.com/users/chuanhtuan/following{/other_user}","gists_url":"https://api.github.com/users/chuanhtuan/gists{/gist_id}","starred_url":"https://api.github.com/users/chuanhtuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuanhtuan/subscriptions","organizations_url":"https://api.github.com/users/chuanhtuan/orgs","repos_url":"https://api.github.com/users/chuanhtuan/repos","events_url":"https://api.github.com/users/chuanhtuan/events{/privacy}","received_events_url":"https://api.github.com/users/chuanhtuan/received_events","type":"User","site_admin":false},"body":"\"","created_at":"2015-02-13T02:33:38Z","updated_at":"2015-02-13T02:33:38Z","html_url":"https://github.com/framgia/fels_36/pull/15#discussion_r24640701","pull_request_url":"https://api.github.com/repos/framgia/fels_36/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_36/pulls/comments/24640701"},"html":{"href":"https://github.com/framgia/fels_36/pull/15#discussion_r24640701"},"pull_request":{"href":"https://api.github.com/repos/framgia/fels_36/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fels_36/pulls/15","id":29169809,"html_url":"https://github.com/framgia/fels_36/pull/15","diff_url":"https://github.com/framgia/fels_36/pull/15.diff","patch_url":"https://github.com/framgia/fels_36/pull/15.patch","issue_url":"https://api.github.com/repos/framgia/fels_36/issues/15","number":15,"state":"open","locked":false,"title":"Create lession","user":{"login":"thai2811","id":5153544,"avatar_url":"https://avatars.githubusercontent.com/u/5153544?v=3","gravatar_id":"","url":"https://api.github.com/users/thai2811","html_url":"https://github.com/thai2811","followers_url":"https://api.github.com/users/thai2811/followers","following_url":"https://api.github.com/users/thai2811/following{/other_user}","gists_url":"https://api.github.com/users/thai2811/gists{/gist_id}","starred_url":"https://api.github.com/users/thai2811/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thai2811/subscriptions","organizations_url":"https://api.github.com/users/thai2811/orgs","repos_url":"https://api.github.com/users/thai2811/repos","events_url":"https://api.github.com/users/thai2811/events{/privacy}","received_events_url":"https://api.github.com/users/thai2811/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-12T11:04:22Z","updated_at":"2015-02-13T02:33:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ad5ad82b6c94b4cdee5a7401bff074abedb0190","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fels_36/pulls/15/commits","review_comments_url":"https://api.github.com/repos/framgia/fels_36/pulls/15/comments","review_comment_url":"https://api.github.com/repos/framgia/fels_36/pulls/comments/{number}","comments_url":"https://api.github.com/repos/framgia/fels_36/issues/15/comments","statuses_url":"https://api.github.com/repos/framgia/fels_36/statuses/317858d981c987384766d611778102edae61cfd4","head":{"label":"thai2811:create_lession","ref":"create_lession","sha":"317858d981c987384766d611778102edae61cfd4","user":{"login":"thai2811","id":5153544,"avatar_url":"https://avatars.githubusercontent.com/u/5153544?v=3","gravatar_id":"","url":"https://api.github.com/users/thai2811","html_url":"https://github.com/thai2811","followers_url":"https://api.github.com/users/thai2811/followers","following_url":"https://api.github.com/users/thai2811/following{/other_user}","gists_url":"https://api.github.com/users/thai2811/gists{/gist_id}","starred_url":"https://api.github.com/users/thai2811/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thai2811/subscriptions","organizations_url":"https://api.github.com/users/thai2811/orgs","repos_url":"https://api.github.com/users/thai2811/repos","events_url":"https://api.github.com/users/thai2811/events{/privacy}","received_events_url":"https://api.github.com/users/thai2811/received_events","type":"User","site_admin":false},"repo":{"id":30344666,"name":"fels_36","full_name":"thai2811/fels_36","owner":{"login":"thai2811","id":5153544,"avatar_url":"https://avatars.githubusercontent.com/u/5153544?v=3","gravatar_id":"","url":"https://api.github.com/users/thai2811","html_url":"https://github.com/thai2811","followers_url":"https://api.github.com/users/thai2811/followers","following_url":"https://api.github.com/users/thai2811/following{/other_user}","gists_url":"https://api.github.com/users/thai2811/gists{/gist_id}","starred_url":"https://api.github.com/users/thai2811/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thai2811/subscriptions","organizations_url":"https://api.github.com/users/thai2811/orgs","repos_url":"https://api.github.com/users/thai2811/repos","events_url":"https://api.github.com/users/thai2811/events{/privacy}","received_events_url":"https://api.github.com/users/thai2811/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thai2811/fels_36","description":"Framgia E-Learning System (training)","fork":true,"url":"https://api.github.com/repos/thai2811/fels_36","forks_url":"https://api.github.com/repos/thai2811/fels_36/forks","keys_url":"https://api.github.com/repos/thai2811/fels_36/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thai2811/fels_36/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thai2811/fels_36/teams","hooks_url":"https://api.github.com/repos/thai2811/fels_36/hooks","issue_events_url":"https://api.github.com/repos/thai2811/fels_36/issues/events{/number}","events_url":"https://api.github.com/repos/thai2811/fels_36/events","assignees_url":"https://api.github.com/repos/thai2811/fels_36/assignees{/user}","branches_url":"https://api.github.com/repos/thai2811/fels_36/branches{/branch}","tags_url":"https://api.github.com/repos/thai2811/fels_36/tags","blobs_url":"https://api.github.com/repos/thai2811/fels_36/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thai2811/fels_36/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thai2811/fels_36/git/refs{/sha}","trees_url":"https://api.github.com/repos/thai2811/fels_36/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thai2811/fels_36/statuses/{sha}","languages_url":"https://api.github.com/repos/thai2811/fels_36/languages","stargazers_url":"https://api.github.com/repos/thai2811/fels_36/stargazers","contributors_url":"https://api.github.com/repos/thai2811/fels_36/contributors","subscribers_url":"https://api.github.com/repos/thai2811/fels_36/subscribers","subscription_url":"https://api.github.com/repos/thai2811/fels_36/subscription","commits_url":"https://api.github.com/repos/thai2811/fels_36/commits{/sha}","git_commits_url":"https://api.github.com/repos/thai2811/fels_36/git/commits{/sha}","comments_url":"https://api.github.com/repos/thai2811/fels_36/comments{/number}","issue_comment_url":"https://api.github.com/repos/thai2811/fels_36/issues/comments/{number}","contents_url":"https://api.github.com/repos/thai2811/fels_36/contents/{+path}","compare_url":"https://api.github.com/repos/thai2811/fels_36/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thai2811/fels_36/merges","archive_url":"https://api.github.com/repos/thai2811/fels_36/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thai2811/fels_36/downloads","issues_url":"https://api.github.com/repos/thai2811/fels_36/issues{/number}","pulls_url":"https://api.github.com/repos/thai2811/fels_36/pulls{/number}","milestones_url":"https://api.github.com/repos/thai2811/fels_36/milestones{/number}","notifications_url":"https://api.github.com/repos/thai2811/fels_36/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thai2811/fels_36/labels{/name}","releases_url":"https://api.github.com/repos/thai2811/fels_36/releases{/id}","created_at":"2015-02-05T08:05:20Z","updated_at":"2015-01-24T12:02:42Z","pushed_at":"2015-02-12T11:03:42Z","git_url":"git://github.com/thai2811/fels_36.git","ssh_url":"git@github.com:thai2811/fels_36.git","clone_url":"https://github.com/thai2811/fels_36.git","svn_url":"https://github.com/thai2811/fels_36","homepage":null,"size":162,"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":"e825091e0157c6e950a2ebefd9350e057935b01f","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":29775217,"name":"fels_36","full_name":"framgia/fels_36","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_36","description":"Framgia E-Learning System (training)","fork":false,"url":"https://api.github.com/repos/framgia/fels_36","forks_url":"https://api.github.com/repos/framgia/fels_36/forks","keys_url":"https://api.github.com/repos/framgia/fels_36/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fels_36/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fels_36/teams","hooks_url":"https://api.github.com/repos/framgia/fels_36/hooks","issue_events_url":"https://api.github.com/repos/framgia/fels_36/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fels_36/events","assignees_url":"https://api.github.com/repos/framgia/fels_36/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fels_36/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fels_36/tags","blobs_url":"https://api.github.com/repos/framgia/fels_36/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fels_36/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fels_36/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fels_36/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fels_36/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fels_36/languages","stargazers_url":"https://api.github.com/repos/framgia/fels_36/stargazers","contributors_url":"https://api.github.com/repos/framgia/fels_36/contributors","subscribers_url":"https://api.github.com/repos/framgia/fels_36/subscribers","subscription_url":"https://api.github.com/repos/framgia/fels_36/subscription","commits_url":"https://api.github.com/repos/framgia/fels_36/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fels_36/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fels_36/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fels_36/issues/comments/{number}","contents_url":"https://api.github.com/repos/framgia/fels_36/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fels_36/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fels_36/merges","archive_url":"https://api.github.com/repos/framgia/fels_36/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fels_36/downloads","issues_url":"https://api.github.com/repos/framgia/fels_36/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fels_36/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fels_36/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fels_36/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fels_36/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fels_36/releases{/id}","created_at":"2015-01-24T12:02:42Z","updated_at":"2015-02-05T10:10:30Z","pushed_at":"2015-02-11T10:30:22Z","git_url":"git://github.com/framgia/fels_36.git","ssh_url":"git@github.com:framgia/fels_36.git","clone_url":"https://github.com/framgia/fels_36.git","svn_url":"https://github.com/framgia/fels_36","homepage":null,"size":255,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_36/pulls/15"},"html":{"href":"https://github.com/framgia/fels_36/pull/15"},"issue":{"href":"https://api.github.com/repos/framgia/fels_36/issues/15"},"comments":{"href":"https://api.github.com/repos/framgia/fels_36/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fels_36/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fels_36/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/framgia/fels_36/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fels_36/statuses/317858d981c987384766d611778102edae61cfd4"}}}}