{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fels_149/pulls/comments/76939026","id":76939026,"diff_hunk":"@@ -3,4 +3,20 @@ class Lesson < ActiveRecord::Base\n   belongs_to :category\n   has_many :results, dependent: :destroy\n   has_many :words, through: :results\n+  after_create :add_words\n+\n+  accepts_nested_attributes_for :results\n+\n+  private\n+\n+  def add_words","path":"app/models/lesson.rb","position":10,"original_position":10,"commit_id":"69973b970d26bb957136192012ff20949598b4bd","original_commit_id":"69973b970d26bb957136192012ff20949598b4bd","user":{"login":"phamvanbk11","id":10772245,"avatar_url":"https://avatars.githubusercontent.com/u/10772245?v=3","gravatar_id":"","url":"https://api.github.com/users/phamvanbk11","html_url":"https://github.com/phamvanbk11","followers_url":"https://api.github.com/users/phamvanbk11/followers","following_url":"https://api.github.com/users/phamvanbk11/following{/other_user}","gists_url":"https://api.github.com/users/phamvanbk11/gists{/gist_id}","starred_url":"https://api.github.com/users/phamvanbk11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phamvanbk11/subscriptions","organizations_url":"https://api.github.com/users/phamvanbk11/orgs","repos_url":"https://api.github.com/users/phamvanbk11/repos","events_url":"https://api.github.com/users/phamvanbk11/events{/privacy}","received_events_url":"https://api.github.com/users/phamvanbk11/received_events","type":"User","site_admin":false},"body":"Ở hàm này em sẽ ưu tiên select những từ chưa học để add vào lesson nếu những từ chưa học còn lại it hơn 10 từ thì em sẽ select thêm những từ đã học rồi cho đủ 10 từ .\r\nAnh gợi ý cách rút gọn giup em với ạ!","created_at":"2016-08-31T07:46:54Z","updated_at":"2016-08-31T07:46:54Z","html_url":"https://github.com/framgia/fels_149/pull/18#discussion_r76939026","pull_request_url":"https://api.github.com/repos/framgia/fels_149/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_149/pulls/comments/76939026"},"html":{"href":"https://github.com/framgia/fels_149/pull/18#discussion_r76939026"},"pull_request":{"href":"https://api.github.com/repos/framgia/fels_149/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fels_149/pulls/18","id":83397011,"html_url":"https://github.com/framgia/fels_149/pull/18","diff_url":"https://github.com/framgia/fels_149/pull/18.diff","patch_url":"https://github.com/framgia/fels_149/pull/18.patch","issue_url":"https://api.github.com/repos/framgia/fels_149/issues/18","number":18,"state":"open","locked":false,"title":"73921 User create lesson","user":{"login":"phamvanbk11","id":10772245,"avatar_url":"https://avatars.githubusercontent.com/u/10772245?v=3","gravatar_id":"","url":"https://api.github.com/users/phamvanbk11","html_url":"https://github.com/phamvanbk11","followers_url":"https://api.github.com/users/phamvanbk11/followers","following_url":"https://api.github.com/users/phamvanbk11/following{/other_user}","gists_url":"https://api.github.com/users/phamvanbk11/gists{/gist_id}","starred_url":"https://api.github.com/users/phamvanbk11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phamvanbk11/subscriptions","organizations_url":"https://api.github.com/users/phamvanbk11/orgs","repos_url":"https://api.github.com/users/phamvanbk11/repos","events_url":"https://api.github.com/users/phamvanbk11/events{/privacy}","received_events_url":"https://api.github.com/users/phamvanbk11/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-31T06:46:08Z","updated_at":"2016-08-31T07:46:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3a6c7ad0e9c311babded5725cc23c7623e9118c1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fels_149/pulls/18/commits","review_comments_url":"https://api.github.com/repos/framgia/fels_149/pulls/18/comments","review_comment_url":"https://api.github.com/repos/framgia/fels_149/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/fels_149/issues/18/comments","statuses_url":"https://api.github.com/repos/framgia/fels_149/statuses/69973b970d26bb957136192012ff20949598b4bd","head":{"label":"phamvanbk11:73921_User_create_lesson","ref":"73921_User_create_lesson","sha":"69973b970d26bb957136192012ff20949598b4bd","user":{"login":"phamvanbk11","id":10772245,"avatar_url":"https://avatars.githubusercontent.com/u/10772245?v=3","gravatar_id":"","url":"https://api.github.com/users/phamvanbk11","html_url":"https://github.com/phamvanbk11","followers_url":"https://api.github.com/users/phamvanbk11/followers","following_url":"https://api.github.com/users/phamvanbk11/following{/other_user}","gists_url":"https://api.github.com/users/phamvanbk11/gists{/gist_id}","starred_url":"https://api.github.com/users/phamvanbk11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phamvanbk11/subscriptions","organizations_url":"https://api.github.com/users/phamvanbk11/orgs","repos_url":"https://api.github.com/users/phamvanbk11/repos","events_url":"https://api.github.com/users/phamvanbk11/events{/privacy}","received_events_url":"https://api.github.com/users/phamvanbk11/received_events","type":"User","site_admin":false},"repo":{"id":66336915,"name":"fels_149","full_name":"phamvanbk11/fels_149","owner":{"login":"phamvanbk11","id":10772245,"avatar_url":"https://avatars.githubusercontent.com/u/10772245?v=3","gravatar_id":"","url":"https://api.github.com/users/phamvanbk11","html_url":"https://github.com/phamvanbk11","followers_url":"https://api.github.com/users/phamvanbk11/followers","following_url":"https://api.github.com/users/phamvanbk11/following{/other_user}","gists_url":"https://api.github.com/users/phamvanbk11/gists{/gist_id}","starred_url":"https://api.github.com/users/phamvanbk11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phamvanbk11/subscriptions","organizations_url":"https://api.github.com/users/phamvanbk11/orgs","repos_url":"https://api.github.com/users/phamvanbk11/repos","events_url":"https://api.github.com/users/phamvanbk11/events{/privacy}","received_events_url":"https://api.github.com/users/phamvanbk11/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/phamvanbk11/fels_149","description":"Framgia E-Learning System (training)","fork":true,"url":"https://api.github.com/repos/phamvanbk11/fels_149","forks_url":"https://api.github.com/repos/phamvanbk11/fels_149/forks","keys_url":"https://api.github.com/repos/phamvanbk11/fels_149/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phamvanbk11/fels_149/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phamvanbk11/fels_149/teams","hooks_url":"https://api.github.com/repos/phamvanbk11/fels_149/hooks","issue_events_url":"https://api.github.com/repos/phamvanbk11/fels_149/issues/events{/number}","events_url":"https://api.github.com/repos/phamvanbk11/fels_149/events","assignees_url":"https://api.github.com/repos/phamvanbk11/fels_149/assignees{/user}","branches_url":"https://api.github.com/repos/phamvanbk11/fels_149/branches{/branch}","tags_url":"https://api.github.com/repos/phamvanbk11/fels_149/tags","blobs_url":"https://api.github.com/repos/phamvanbk11/fels_149/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phamvanbk11/fels_149/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phamvanbk11/fels_149/git/refs{/sha}","trees_url":"https://api.github.com/repos/phamvanbk11/fels_149/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phamvanbk11/fels_149/statuses/{sha}","languages_url":"https://api.github.com/repos/phamvanbk11/fels_149/languages","stargazers_url":"https://api.github.com/repos/phamvanbk11/fels_149/stargazers","contributors_url":"https://api.github.com/repos/phamvanbk11/fels_149/contributors","subscribers_url":"https://api.github.com/repos/phamvanbk11/fels_149/subscribers","subscription_url":"https://api.github.com/repos/phamvanbk11/fels_149/subscription","commits_url":"https://api.github.com/repos/phamvanbk11/fels_149/commits{/sha}","git_commits_url":"https://api.github.com/repos/phamvanbk11/fels_149/git/commits{/sha}","comments_url":"https://api.github.com/repos/phamvanbk11/fels_149/comments{/number}","issue_comment_url":"https://api.github.com/repos/phamvanbk11/fels_149/issues/comments{/number}","contents_url":"https://api.github.com/repos/phamvanbk11/fels_149/contents/{+path}","compare_url":"https://api.github.com/repos/phamvanbk11/fels_149/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phamvanbk11/fels_149/merges","archive_url":"https://api.github.com/repos/phamvanbk11/fels_149/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phamvanbk11/fels_149/downloads","issues_url":"https://api.github.com/repos/phamvanbk11/fels_149/issues{/number}","pulls_url":"https://api.github.com/repos/phamvanbk11/fels_149/pulls{/number}","milestones_url":"https://api.github.com/repos/phamvanbk11/fels_149/milestones{/number}","notifications_url":"https://api.github.com/repos/phamvanbk11/fels_149/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phamvanbk11/fels_149/labels{/name}","releases_url":"https://api.github.com/repos/phamvanbk11/fels_149/releases{/id}","deployments_url":"https://api.github.com/repos/phamvanbk11/fels_149/deployments","created_at":"2016-08-23T05:46:10Z","updated_at":"2016-06-20T05:55:16Z","pushed_at":"2016-08-31T07:36:58Z","git_url":"git://github.com/phamvanbk11/fels_149.git","ssh_url":"git@github.com:phamvanbk11/fels_149.git","clone_url":"https://github.com/phamvanbk11/fels_149.git","svn_url":"https://github.com/phamvanbk11/fels_149","homepage":null,"size":87,"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":"4481a71dba131c65a9dbed5e08db04e0097d244d","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":61520426,"name":"fels_149","full_name":"framgia/fels_149","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_149","description":"Framgia E-Learning System (training)","fork":false,"url":"https://api.github.com/repos/framgia/fels_149","forks_url":"https://api.github.com/repos/framgia/fels_149/forks","keys_url":"https://api.github.com/repos/framgia/fels_149/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fels_149/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fels_149/teams","hooks_url":"https://api.github.com/repos/framgia/fels_149/hooks","issue_events_url":"https://api.github.com/repos/framgia/fels_149/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fels_149/events","assignees_url":"https://api.github.com/repos/framgia/fels_149/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fels_149/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fels_149/tags","blobs_url":"https://api.github.com/repos/framgia/fels_149/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fels_149/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fels_149/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fels_149/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fels_149/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fels_149/languages","stargazers_url":"https://api.github.com/repos/framgia/fels_149/stargazers","contributors_url":"https://api.github.com/repos/framgia/fels_149/contributors","subscribers_url":"https://api.github.com/repos/framgia/fels_149/subscribers","subscription_url":"https://api.github.com/repos/framgia/fels_149/subscription","commits_url":"https://api.github.com/repos/framgia/fels_149/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fels_149/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fels_149/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fels_149/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/fels_149/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fels_149/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fels_149/merges","archive_url":"https://api.github.com/repos/framgia/fels_149/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fels_149/downloads","issues_url":"https://api.github.com/repos/framgia/fels_149/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fels_149/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fels_149/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fels_149/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fels_149/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fels_149/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/fels_149/deployments","created_at":"2016-06-20T05:55:16Z","updated_at":"2016-06-20T05:55:16Z","pushed_at":"2016-08-31T07:36:58Z","git_url":"git://github.com/framgia/fels_149.git","ssh_url":"git@github.com:framgia/fels_149.git","clone_url":"https://github.com/framgia/fels_149.git","svn_url":"https://github.com/framgia/fels_149","homepage":null,"size":87,"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_149/pulls/18"},"html":{"href":"https://github.com/framgia/fels_149/pull/18"},"issue":{"href":"https://api.github.com/repos/framgia/fels_149/issues/18"},"comments":{"href":"https://api.github.com/repos/framgia/fels_149/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fels_149/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fels_149/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/fels_149/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fels_149/statuses/69973b970d26bb957136192012ff20949598b4bd"}}}}
{"actor":{"display_login":"phamvanbk11"}}