{"action":"created","comment":{"url":"https://api.github.com/repos/AbdullahAlger/blocipedia/pulls/comments/34985024","id":34985024,"diff_hunk":"@@ -6,16 +6,24 @@ class User < ActiveRecord::Base\n \n   has_many :wiki, dependent: :destroy\n \n+  after_initialize :set_role\n+\n   def admin?\n     role == 'admin'\n   end\n \n-  def standard?\n-    role == 'standard'\n-  end\n-\n   def premium?\n     role == 'premium'\n   end\n \n+  def upgrade_account?\n+    self.update_attributes(role: \"premium\")\n+  end\n+\n+  def set_role\n+    if self.role == nil","path":"app/models/user.rb","position":23,"original_position":23,"commit_id":"c58cba89a24de958724b8484a9f8fdc3e743fa8f","original_commit_id":"c58cba89a24de958724b8484a9f8fdc3e743fa8f","user":{"login":"AbdullahAlger","id":6264696,"avatar_url":"https://avatars.githubusercontent.com/u/6264696?v=3","gravatar_id":"","url":"https://api.github.com/users/AbdullahAlger","html_url":"https://github.com/AbdullahAlger","followers_url":"https://api.github.com/users/AbdullahAlger/followers","following_url":"https://api.github.com/users/AbdullahAlger/following{/other_user}","gists_url":"https://api.github.com/users/AbdullahAlger/gists{/gist_id}","starred_url":"https://api.github.com/users/AbdullahAlger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbdullahAlger/subscriptions","organizations_url":"https://api.github.com/users/AbdullahAlger/orgs","repos_url":"https://api.github.com/users/AbdullahAlger/repos","events_url":"https://api.github.com/users/AbdullahAlger/events{/privacy}","received_events_url":"https://api.github.com/users/AbdullahAlger/received_events","type":"User","site_admin":false},"body":"This has been changed in the last commit","created_at":"2015-07-20T11:13:07Z","updated_at":"2015-07-20T11:13:07Z","html_url":"https://github.com/AbdullahAlger/blocipedia/pull/15#discussion_r34985024","pull_request_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/AbdullahAlger/blocipedia/pulls/comments/34985024"},"html":{"href":"https://github.com/AbdullahAlger/blocipedia/pull/15#discussion_r34985024"},"pull_request":{"href":"https://api.github.com/repos/AbdullahAlger/blocipedia/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/AbdullahAlger/blocipedia/pulls/15","id":40311824,"html_url":"https://github.com/AbdullahAlger/blocipedia/pull/15","diff_url":"https://github.com/AbdullahAlger/blocipedia/pull/15.diff","patch_url":"https://github.com/AbdullahAlger/blocipedia/pull/15.patch","issue_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/issues/15","number":15,"state":"closed","locked":false,"title":"still working with stripe and users","user":{"login":"AbdullahAlger","id":6264696,"avatar_url":"https://avatars.githubusercontent.com/u/6264696?v=3","gravatar_id":"","url":"https://api.github.com/users/AbdullahAlger","html_url":"https://github.com/AbdullahAlger","followers_url":"https://api.github.com/users/AbdullahAlger/followers","following_url":"https://api.github.com/users/AbdullahAlger/following{/other_user}","gists_url":"https://api.github.com/users/AbdullahAlger/gists{/gist_id}","starred_url":"https://api.github.com/users/AbdullahAlger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbdullahAlger/subscriptions","organizations_url":"https://api.github.com/users/AbdullahAlger/orgs","repos_url":"https://api.github.com/users/AbdullahAlger/repos","events_url":"https://api.github.com/users/AbdullahAlger/events{/privacy}","received_events_url":"https://api.github.com/users/AbdullahAlger/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-19T17:30:14Z","updated_at":"2015-07-20T11:13:07Z","closed_at":"2015-07-19T17:30:36Z","merged_at":"2015-07-19T17:30:36Z","merge_commit_sha":"f792381fa6a7f217fa966233c994612f45b645d3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/pulls/15/commits","review_comments_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/pulls/15/comments","review_comment_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/issues/15/comments","statuses_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/statuses/c58cba89a24de958724b8484a9f8fdc3e743fa8f","head":{"label":"AbdullahAlger:premium-standard-users","ref":"premium-standard-users","sha":"c58cba89a24de958724b8484a9f8fdc3e743fa8f","user":{"login":"AbdullahAlger","id":6264696,"avatar_url":"https://avatars.githubusercontent.com/u/6264696?v=3","gravatar_id":"","url":"https://api.github.com/users/AbdullahAlger","html_url":"https://github.com/AbdullahAlger","followers_url":"https://api.github.com/users/AbdullahAlger/followers","following_url":"https://api.github.com/users/AbdullahAlger/following{/other_user}","gists_url":"https://api.github.com/users/AbdullahAlger/gists{/gist_id}","starred_url":"https://api.github.com/users/AbdullahAlger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbdullahAlger/subscriptions","organizations_url":"https://api.github.com/users/AbdullahAlger/orgs","repos_url":"https://api.github.com/users/AbdullahAlger/repos","events_url":"https://api.github.com/users/AbdullahAlger/events{/privacy}","received_events_url":"https://api.github.com/users/AbdullahAlger/received_events","type":"User","site_admin":false},"repo":{"id":38232952,"name":"blocipedia","full_name":"AbdullahAlger/blocipedia","owner":{"login":"AbdullahAlger","id":6264696,"avatar_url":"https://avatars.githubusercontent.com/u/6264696?v=3","gravatar_id":"","url":"https://api.github.com/users/AbdullahAlger","html_url":"https://github.com/AbdullahAlger","followers_url":"https://api.github.com/users/AbdullahAlger/followers","following_url":"https://api.github.com/users/AbdullahAlger/following{/other_user}","gists_url":"https://api.github.com/users/AbdullahAlger/gists{/gist_id}","starred_url":"https://api.github.com/users/AbdullahAlger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbdullahAlger/subscriptions","organizations_url":"https://api.github.com/users/AbdullahAlger/orgs","repos_url":"https://api.github.com/users/AbdullahAlger/repos","events_url":"https://api.github.com/users/AbdullahAlger/events{/privacy}","received_events_url":"https://api.github.com/users/AbdullahAlger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AbdullahAlger/blocipedia","description":"","fork":false,"url":"https://api.github.com/repos/AbdullahAlger/blocipedia","forks_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/forks","keys_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/teams","hooks_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/hooks","issue_events_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/issues/events{/number}","events_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/events","assignees_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/assignees{/user}","branches_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/branches{/branch}","tags_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/tags","blobs_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/git/refs{/sha}","trees_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/statuses/{sha}","languages_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/languages","stargazers_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/stargazers","contributors_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/contributors","subscribers_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/subscribers","subscription_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/subscription","commits_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/commits{/sha}","git_commits_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/git/commits{/sha}","comments_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/comments{/number}","issue_comment_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/issues/comments{/number}","contents_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/contents/{+path}","compare_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/merges","archive_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/downloads","issues_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/issues{/number}","pulls_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/pulls{/number}","milestones_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/milestones{/number}","notifications_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/labels{/name}","releases_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/releases{/id}","created_at":"2015-06-29T07:10:46Z","updated_at":"2015-06-29T07:13:51Z","pushed_at":"2015-07-20T10:39:47Z","git_url":"git://github.com/AbdullahAlger/blocipedia.git","ssh_url":"git@github.com:AbdullahAlger/blocipedia.git","clone_url":"https://github.com/AbdullahAlger/blocipedia.git","svn_url":"https://github.com/AbdullahAlger/blocipedia","homepage":null,"size":1936,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"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":"AbdullahAlger:master","ref":"master","sha":"04f2781963cb02dc63bc6e36de6d14fadd5f7264","user":{"login":"AbdullahAlger","id":6264696,"avatar_url":"https://avatars.githubusercontent.com/u/6264696?v=3","gravatar_id":"","url":"https://api.github.com/users/AbdullahAlger","html_url":"https://github.com/AbdullahAlger","followers_url":"https://api.github.com/users/AbdullahAlger/followers","following_url":"https://api.github.com/users/AbdullahAlger/following{/other_user}","gists_url":"https://api.github.com/users/AbdullahAlger/gists{/gist_id}","starred_url":"https://api.github.com/users/AbdullahAlger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbdullahAlger/subscriptions","organizations_url":"https://api.github.com/users/AbdullahAlger/orgs","repos_url":"https://api.github.com/users/AbdullahAlger/repos","events_url":"https://api.github.com/users/AbdullahAlger/events{/privacy}","received_events_url":"https://api.github.com/users/AbdullahAlger/received_events","type":"User","site_admin":false},"repo":{"id":38232952,"name":"blocipedia","full_name":"AbdullahAlger/blocipedia","owner":{"login":"AbdullahAlger","id":6264696,"avatar_url":"https://avatars.githubusercontent.com/u/6264696?v=3","gravatar_id":"","url":"https://api.github.com/users/AbdullahAlger","html_url":"https://github.com/AbdullahAlger","followers_url":"https://api.github.com/users/AbdullahAlger/followers","following_url":"https://api.github.com/users/AbdullahAlger/following{/other_user}","gists_url":"https://api.github.com/users/AbdullahAlger/gists{/gist_id}","starred_url":"https://api.github.com/users/AbdullahAlger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbdullahAlger/subscriptions","organizations_url":"https://api.github.com/users/AbdullahAlger/orgs","repos_url":"https://api.github.com/users/AbdullahAlger/repos","events_url":"https://api.github.com/users/AbdullahAlger/events{/privacy}","received_events_url":"https://api.github.com/users/AbdullahAlger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AbdullahAlger/blocipedia","description":"","fork":false,"url":"https://api.github.com/repos/AbdullahAlger/blocipedia","forks_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/forks","keys_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/teams","hooks_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/hooks","issue_events_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/issues/events{/number}","events_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/events","assignees_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/assignees{/user}","branches_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/branches{/branch}","tags_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/tags","blobs_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/git/refs{/sha}","trees_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/statuses/{sha}","languages_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/languages","stargazers_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/stargazers","contributors_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/contributors","subscribers_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/subscribers","subscription_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/subscription","commits_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/commits{/sha}","git_commits_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/git/commits{/sha}","comments_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/comments{/number}","issue_comment_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/issues/comments{/number}","contents_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/contents/{+path}","compare_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/merges","archive_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/downloads","issues_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/issues{/number}","pulls_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/pulls{/number}","milestones_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/milestones{/number}","notifications_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/labels{/name}","releases_url":"https://api.github.com/repos/AbdullahAlger/blocipedia/releases{/id}","created_at":"2015-06-29T07:10:46Z","updated_at":"2015-06-29T07:13:51Z","pushed_at":"2015-07-20T10:39:47Z","git_url":"git://github.com/AbdullahAlger/blocipedia.git","ssh_url":"git@github.com:AbdullahAlger/blocipedia.git","clone_url":"https://github.com/AbdullahAlger/blocipedia.git","svn_url":"https://github.com/AbdullahAlger/blocipedia","homepage":null,"size":1936,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"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"}},"_links":{"self":{"href":"https://api.github.com/repos/AbdullahAlger/blocipedia/pulls/15"},"html":{"href":"https://github.com/AbdullahAlger/blocipedia/pull/15"},"issue":{"href":"https://api.github.com/repos/AbdullahAlger/blocipedia/issues/15"},"comments":{"href":"https://api.github.com/repos/AbdullahAlger/blocipedia/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/AbdullahAlger/blocipedia/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/AbdullahAlger/blocipedia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AbdullahAlger/blocipedia/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/AbdullahAlger/blocipedia/statuses/c58cba89a24de958724b8484a9f8fdc3e743fa8f"}}}}