{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fels_35/pulls/comments/24286058","id":24286058,"diff_hunk":"@@ -11,4 +11,34 @@ class User < ActiveRecord::Base\n   before_save {self.email = email.downcase}\n \n   has_secure_password\n+\n+  has_many :relationships, foreign_key: \"follower_id\", dependent: :destroy\n+  has_many :followed_users, through: :relationships, source: :followed\n+  has_many :reverse_relationships, foreign_key: \"followed_id\",\n+           class_name:  \"Relationship\",\n+           dependent:   :destroy\n+  has_many :followers, through: :reverse_relationships, source: :follower\n+  has_many :lessons\n+  has_many :user_words\n+  has_many :activities\n+\n+  def User.new_remember_token\n+    SecureRandom.urlsafe_base64\n+  end\n+\n+  def User.digest(token)\n+    Digest::SHA1.hexdigest(token.to_s)\n+  end\n+\n+  def following?(other_user)\n+    relationships.find_by(followed_id: other_user.id)\n+  end\n+\n+  def follow!(other_user)\n+    relationships.create!(followed_id: other_user.id)","path":"app/models/user.rb","position":28,"original_position":28,"commit_id":"4f0182768612391ee677ab90e26392faa1005afc","original_commit_id":"4f0182768612391ee677ab90e26392faa1005afc","user":{"login":"dieunb","id":2122175,"avatar_url":"https://avatars.githubusercontent.com/u/2122175?v=3","gravatar_id":"","url":"https://api.github.com/users/dieunb","html_url":"https://github.com/dieunb","followers_url":"https://api.github.com/users/dieunb/followers","following_url":"https://api.github.com/users/dieunb/following{/other_user}","gists_url":"https://api.github.com/users/dieunb/gists{/gist_id}","starred_url":"https://api.github.com/users/dieunb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dieunb/subscriptions","organizations_url":"https://api.github.com/users/dieunb/orgs","repos_url":"https://api.github.com/users/dieunb/repos","events_url":"https://api.github.com/users/dieunb/events{/privacy}","received_events_url":"https://api.github.com/users/dieunb/received_events","type":"User","site_admin":false},"body":"remove ()","created_at":"2015-02-07T02:50:39Z","updated_at":"2015-02-07T02:50:39Z","html_url":"https://github.com/framgia/fels_35/pull/5#discussion_r24286058","pull_request_url":"https://api.github.com/repos/framgia/fels_35/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_35/pulls/comments/24286058"},"html":{"href":"https://github.com/framgia/fels_35/pull/5#discussion_r24286058"},"pull_request":{"href":"https://api.github.com/repos/framgia/fels_35/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fels_35/pulls/5","id":28856378,"html_url":"https://github.com/framgia/fels_35/pull/5","diff_url":"https://github.com/framgia/fels_35/pull/5.diff","patch_url":"https://github.com/framgia/fels_35/pull/5.patch","issue_url":"https://api.github.com/repos/framgia/fels_35/issues/5","number":5,"state":"open","locked":false,"title":"Refactor models","user":{"login":"QuangTranXuan","id":5158847,"avatar_url":"https://avatars.githubusercontent.com/u/5158847?v=3","gravatar_id":"","url":"https://api.github.com/users/QuangTranXuan","html_url":"https://github.com/QuangTranXuan","followers_url":"https://api.github.com/users/QuangTranXuan/followers","following_url":"https://api.github.com/users/QuangTranXuan/following{/other_user}","gists_url":"https://api.github.com/users/QuangTranXuan/gists{/gist_id}","starred_url":"https://api.github.com/users/QuangTranXuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuangTranXuan/subscriptions","organizations_url":"https://api.github.com/users/QuangTranXuan/orgs","repos_url":"https://api.github.com/users/QuangTranXuan/repos","events_url":"https://api.github.com/users/QuangTranXuan/events{/privacy}","received_events_url":"https://api.github.com/users/QuangTranXuan/received_events","type":"User","site_admin":false},"body":"Refactor models","created_at":"2015-02-07T01:47:41Z","updated_at":"2015-02-07T02:50:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53f885c42f9c3d448cc23cf241d09ca2c898edf5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fels_35/pulls/5/commits","review_comments_url":"https://api.github.com/repos/framgia/fels_35/pulls/5/comments","review_comment_url":"https://api.github.com/repos/framgia/fels_35/pulls/comments/{number}","comments_url":"https://api.github.com/repos/framgia/fels_35/issues/5/comments","statuses_url":"https://api.github.com/repos/framgia/fels_35/statuses/4f0182768612391ee677ab90e26392faa1005afc","head":{"label":"QuangTranXuan:refactor_models","ref":"refactor_models","sha":"4f0182768612391ee677ab90e26392faa1005afc","user":{"login":"QuangTranXuan","id":5158847,"avatar_url":"https://avatars.githubusercontent.com/u/5158847?v=3","gravatar_id":"","url":"https://api.github.com/users/QuangTranXuan","html_url":"https://github.com/QuangTranXuan","followers_url":"https://api.github.com/users/QuangTranXuan/followers","following_url":"https://api.github.com/users/QuangTranXuan/following{/other_user}","gists_url":"https://api.github.com/users/QuangTranXuan/gists{/gist_id}","starred_url":"https://api.github.com/users/QuangTranXuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuangTranXuan/subscriptions","organizations_url":"https://api.github.com/users/QuangTranXuan/orgs","repos_url":"https://api.github.com/users/QuangTranXuan/repos","events_url":"https://api.github.com/users/QuangTranXuan/events{/privacy}","received_events_url":"https://api.github.com/users/QuangTranXuan/received_events","type":"User","site_admin":false},"repo":{"id":30416938,"name":"fels_35","full_name":"QuangTranXuan/fels_35","owner":{"login":"QuangTranXuan","id":5158847,"avatar_url":"https://avatars.githubusercontent.com/u/5158847?v=3","gravatar_id":"","url":"https://api.github.com/users/QuangTranXuan","html_url":"https://github.com/QuangTranXuan","followers_url":"https://api.github.com/users/QuangTranXuan/followers","following_url":"https://api.github.com/users/QuangTranXuan/following{/other_user}","gists_url":"https://api.github.com/users/QuangTranXuan/gists{/gist_id}","starred_url":"https://api.github.com/users/QuangTranXuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuangTranXuan/subscriptions","organizations_url":"https://api.github.com/users/QuangTranXuan/orgs","repos_url":"https://api.github.com/users/QuangTranXuan/repos","events_url":"https://api.github.com/users/QuangTranXuan/events{/privacy}","received_events_url":"https://api.github.com/users/QuangTranXuan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/QuangTranXuan/fels_35","description":"Framgia E-Learning System (training)","fork":true,"url":"https://api.github.com/repos/QuangTranXuan/fels_35","forks_url":"https://api.github.com/repos/QuangTranXuan/fels_35/forks","keys_url":"https://api.github.com/repos/QuangTranXuan/fels_35/keys{/key_id}","collaborators_url":"https://api.github.com/repos/QuangTranXuan/fels_35/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/QuangTranXuan/fels_35/teams","hooks_url":"https://api.github.com/repos/QuangTranXuan/fels_35/hooks","issue_events_url":"https://api.github.com/repos/QuangTranXuan/fels_35/issues/events{/number}","events_url":"https://api.github.com/repos/QuangTranXuan/fels_35/events","assignees_url":"https://api.github.com/repos/QuangTranXuan/fels_35/assignees{/user}","branches_url":"https://api.github.com/repos/QuangTranXuan/fels_35/branches{/branch}","tags_url":"https://api.github.com/repos/QuangTranXuan/fels_35/tags","blobs_url":"https://api.github.com/repos/QuangTranXuan/fels_35/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/QuangTranXuan/fels_35/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/QuangTranXuan/fels_35/git/refs{/sha}","trees_url":"https://api.github.com/repos/QuangTranXuan/fels_35/git/trees{/sha}","statuses_url":"https://api.github.com/repos/QuangTranXuan/fels_35/statuses/{sha}","languages_url":"https://api.github.com/repos/QuangTranXuan/fels_35/languages","stargazers_url":"https://api.github.com/repos/QuangTranXuan/fels_35/stargazers","contributors_url":"https://api.github.com/repos/QuangTranXuan/fels_35/contributors","subscribers_url":"https://api.github.com/repos/QuangTranXuan/fels_35/subscribers","subscription_url":"https://api.github.com/repos/QuangTranXuan/fels_35/subscription","commits_url":"https://api.github.com/repos/QuangTranXuan/fels_35/commits{/sha}","git_commits_url":"https://api.github.com/repos/QuangTranXuan/fels_35/git/commits{/sha}","comments_url":"https://api.github.com/repos/QuangTranXuan/fels_35/comments{/number}","issue_comment_url":"https://api.github.com/repos/QuangTranXuan/fels_35/issues/comments/{number}","contents_url":"https://api.github.com/repos/QuangTranXuan/fels_35/contents/{+path}","compare_url":"https://api.github.com/repos/QuangTranXuan/fels_35/compare/{base}...{head}","merges_url":"https://api.github.com/repos/QuangTranXuan/fels_35/merges","archive_url":"https://api.github.com/repos/QuangTranXuan/fels_35/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/QuangTranXuan/fels_35/downloads","issues_url":"https://api.github.com/repos/QuangTranXuan/fels_35/issues{/number}","pulls_url":"https://api.github.com/repos/QuangTranXuan/fels_35/pulls{/number}","milestones_url":"https://api.github.com/repos/QuangTranXuan/fels_35/milestones{/number}","notifications_url":"https://api.github.com/repos/QuangTranXuan/fels_35/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/QuangTranXuan/fels_35/labels{/name}","releases_url":"https://api.github.com/repos/QuangTranXuan/fels_35/releases{/id}","created_at":"2015-02-06T14:50:37Z","updated_at":"2015-01-24T12:02:13Z","pushed_at":"2015-02-07T02:40:03Z","git_url":"git://github.com/QuangTranXuan/fels_35.git","ssh_url":"git@github.com:QuangTranXuan/fels_35.git","clone_url":"https://github.com/QuangTranXuan/fels_35.git","svn_url":"https://github.com/QuangTranXuan/fels_35","homepage":null,"size":148,"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":"a237a223a41f728fcddf7366603de5d4cf0257ae","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":29775206,"name":"fels_35","full_name":"framgia/fels_35","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_35","description":"Framgia E-Learning System (training)","fork":false,"url":"https://api.github.com/repos/framgia/fels_35","forks_url":"https://api.github.com/repos/framgia/fels_35/forks","keys_url":"https://api.github.com/repos/framgia/fels_35/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fels_35/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fels_35/teams","hooks_url":"https://api.github.com/repos/framgia/fels_35/hooks","issue_events_url":"https://api.github.com/repos/framgia/fels_35/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fels_35/events","assignees_url":"https://api.github.com/repos/framgia/fels_35/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fels_35/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fels_35/tags","blobs_url":"https://api.github.com/repos/framgia/fels_35/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fels_35/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fels_35/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fels_35/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fels_35/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fels_35/languages","stargazers_url":"https://api.github.com/repos/framgia/fels_35/stargazers","contributors_url":"https://api.github.com/repos/framgia/fels_35/contributors","subscribers_url":"https://api.github.com/repos/framgia/fels_35/subscribers","subscription_url":"https://api.github.com/repos/framgia/fels_35/subscription","commits_url":"https://api.github.com/repos/framgia/fels_35/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fels_35/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fels_35/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fels_35/issues/comments/{number}","contents_url":"https://api.github.com/repos/framgia/fels_35/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fels_35/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fels_35/merges","archive_url":"https://api.github.com/repos/framgia/fels_35/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fels_35/downloads","issues_url":"https://api.github.com/repos/framgia/fels_35/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fels_35/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fels_35/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fels_35/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fels_35/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fels_35/releases{/id}","created_at":"2015-01-24T12:02:13Z","updated_at":"2015-01-24T12:02:13Z","pushed_at":"2015-02-06T03:33:08Z","git_url":"git://github.com/framgia/fels_35.git","ssh_url":"git@github.com:framgia/fels_35.git","clone_url":"https://github.com/framgia/fels_35.git","svn_url":"https://github.com/framgia/fels_35","homepage":null,"size":148,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_35/pulls/5"},"html":{"href":"https://github.com/framgia/fels_35/pull/5"},"issue":{"href":"https://api.github.com/repos/framgia/fels_35/issues/5"},"comments":{"href":"https://api.github.com/repos/framgia/fels_35/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fels_35/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fels_35/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/framgia/fels_35/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fels_35/statuses/4f0182768612391ee677ab90e26392faa1005afc"}}}}