{"action":"created","comment":{"url":"https://api.github.com/repos/kont-noor/Theblog/pulls/comments/48526301","id":48526301,"diff_hunk":"@@ -25,7 +25,7 @@ def unblock?\n     end\n \n     def account_can_update_record?\n-      (user == record.author && account_has_role?(user, [:editor])) ||\n+      (user.try(:id) == record.author.try(:id) && account_has_role?(user, [:editor])) ||","path":"app/policies/theblog/content_node_policy.rb","position":5,"original_position":5,"commit_id":"250cfc0e5c835d088b3510e47abc4a71dd8d0125","original_commit_id":"012521d154492ac4225385ae0b5c3ecba5ccd5db","user":{"login":"DevMike","id":635664,"avatar_url":"https://avatars.githubusercontent.com/u/635664?v=3","gravatar_id":"","url":"https://api.github.com/users/DevMike","html_url":"https://github.com/DevMike","followers_url":"https://api.github.com/users/DevMike/followers","following_url":"https://api.github.com/users/DevMike/following{/other_user}","gists_url":"https://api.github.com/users/DevMike/gists{/gist_id}","starred_url":"https://api.github.com/users/DevMike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DevMike/subscriptions","organizations_url":"https://api.github.com/users/DevMike/orgs","repos_url":"https://api.github.com/users/DevMike/repos","events_url":"https://api.github.com/users/DevMike/events{/privacy}","received_events_url":"https://api.github.com/users/DevMike/received_events","type":"User","site_admin":false},"body":"about changing relation - it was the first thing came to my mind, but once we still use Incarnator.account_model to authorise, there are a lot of other troubles.\r\nAbout has_role? - could you explain?","created_at":"2015-12-29T08:12:38Z","updated_at":"2015-12-29T08:12:38Z","html_url":"https://github.com/kont-noor/Theblog/pull/34#discussion_r48526301","pull_request_url":"https://api.github.com/repos/kont-noor/Theblog/pulls/34","_links":{"self":{"href":"https://api.github.com/repos/kont-noor/Theblog/pulls/comments/48526301"},"html":{"href":"https://github.com/kont-noor/Theblog/pull/34#discussion_r48526301"},"pull_request":{"href":"https://api.github.com/repos/kont-noor/Theblog/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/kont-noor/Theblog/pulls/34","id":54566574,"html_url":"https://github.com/kont-noor/Theblog/pull/34","diff_url":"https://github.com/kont-noor/Theblog/pull/34.diff","patch_url":"https://github.com/kont-noor/Theblog/pull/34.patch","issue_url":"https://api.github.com/repos/kont-noor/Theblog/issues/34","number":34,"state":"open","locked":false,"title":"accounts roles management","user":{"login":"DevMike","id":635664,"avatar_url":"https://avatars.githubusercontent.com/u/635664?v=3","gravatar_id":"","url":"https://api.github.com/users/DevMike","html_url":"https://github.com/DevMike","followers_url":"https://api.github.com/users/DevMike/followers","following_url":"https://api.github.com/users/DevMike/following{/other_user}","gists_url":"https://api.github.com/users/DevMike/gists{/gist_id}","starred_url":"https://api.github.com/users/DevMike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DevMike/subscriptions","organizations_url":"https://api.github.com/users/DevMike/orgs","repos_url":"https://api.github.com/users/DevMike/repos","events_url":"https://api.github.com/users/DevMike/events{/privacy}","received_events_url":"https://api.github.com/users/DevMike/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-24T21:25:55Z","updated_at":"2015-12-29T08:12:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"391ded7d073e68aea12e993ff3862c6cb91e48cf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kont-noor/Theblog/pulls/34/commits","review_comments_url":"https://api.github.com/repos/kont-noor/Theblog/pulls/34/comments","review_comment_url":"https://api.github.com/repos/kont-noor/Theblog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kont-noor/Theblog/issues/34/comments","statuses_url":"https://api.github.com/repos/kont-noor/Theblog/statuses/250cfc0e5c835d088b3510e47abc4a71dd8d0125","head":{"label":"DevMike:accounts_roles_management","ref":"accounts_roles_management","sha":"250cfc0e5c835d088b3510e47abc4a71dd8d0125","user":{"login":"DevMike","id":635664,"avatar_url":"https://avatars.githubusercontent.com/u/635664?v=3","gravatar_id":"","url":"https://api.github.com/users/DevMike","html_url":"https://github.com/DevMike","followers_url":"https://api.github.com/users/DevMike/followers","following_url":"https://api.github.com/users/DevMike/following{/other_user}","gists_url":"https://api.github.com/users/DevMike/gists{/gist_id}","starred_url":"https://api.github.com/users/DevMike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DevMike/subscriptions","organizations_url":"https://api.github.com/users/DevMike/orgs","repos_url":"https://api.github.com/users/DevMike/repos","events_url":"https://api.github.com/users/DevMike/events{/privacy}","received_events_url":"https://api.github.com/users/DevMike/received_events","type":"User","site_admin":false},"repo":{"id":48134327,"name":"Theblog","full_name":"DevMike/Theblog","owner":{"login":"DevMike","id":635664,"avatar_url":"https://avatars.githubusercontent.com/u/635664?v=3","gravatar_id":"","url":"https://api.github.com/users/DevMike","html_url":"https://github.com/DevMike","followers_url":"https://api.github.com/users/DevMike/followers","following_url":"https://api.github.com/users/DevMike/following{/other_user}","gists_url":"https://api.github.com/users/DevMike/gists{/gist_id}","starred_url":"https://api.github.com/users/DevMike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DevMike/subscriptions","organizations_url":"https://api.github.com/users/DevMike/orgs","repos_url":"https://api.github.com/users/DevMike/repos","events_url":"https://api.github.com/users/DevMike/events{/privacy}","received_events_url":"https://api.github.com/users/DevMike/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DevMike/Theblog","description":"Default blogging engine for most purposes","fork":true,"url":"https://api.github.com/repos/DevMike/Theblog","forks_url":"https://api.github.com/repos/DevMike/Theblog/forks","keys_url":"https://api.github.com/repos/DevMike/Theblog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DevMike/Theblog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DevMike/Theblog/teams","hooks_url":"https://api.github.com/repos/DevMike/Theblog/hooks","issue_events_url":"https://api.github.com/repos/DevMike/Theblog/issues/events{/number}","events_url":"https://api.github.com/repos/DevMike/Theblog/events","assignees_url":"https://api.github.com/repos/DevMike/Theblog/assignees{/user}","branches_url":"https://api.github.com/repos/DevMike/Theblog/branches{/branch}","tags_url":"https://api.github.com/repos/DevMike/Theblog/tags","blobs_url":"https://api.github.com/repos/DevMike/Theblog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DevMike/Theblog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DevMike/Theblog/git/refs{/sha}","trees_url":"https://api.github.com/repos/DevMike/Theblog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DevMike/Theblog/statuses/{sha}","languages_url":"https://api.github.com/repos/DevMike/Theblog/languages","stargazers_url":"https://api.github.com/repos/DevMike/Theblog/stargazers","contributors_url":"https://api.github.com/repos/DevMike/Theblog/contributors","subscribers_url":"https://api.github.com/repos/DevMike/Theblog/subscribers","subscription_url":"https://api.github.com/repos/DevMike/Theblog/subscription","commits_url":"https://api.github.com/repos/DevMike/Theblog/commits{/sha}","git_commits_url":"https://api.github.com/repos/DevMike/Theblog/git/commits{/sha}","comments_url":"https://api.github.com/repos/DevMike/Theblog/comments{/number}","issue_comment_url":"https://api.github.com/repos/DevMike/Theblog/issues/comments{/number}","contents_url":"https://api.github.com/repos/DevMike/Theblog/contents/{+path}","compare_url":"https://api.github.com/repos/DevMike/Theblog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DevMike/Theblog/merges","archive_url":"https://api.github.com/repos/DevMike/Theblog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DevMike/Theblog/downloads","issues_url":"https://api.github.com/repos/DevMike/Theblog/issues{/number}","pulls_url":"https://api.github.com/repos/DevMike/Theblog/pulls{/number}","milestones_url":"https://api.github.com/repos/DevMike/Theblog/milestones{/number}","notifications_url":"https://api.github.com/repos/DevMike/Theblog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DevMike/Theblog/labels{/name}","releases_url":"https://api.github.com/repos/DevMike/Theblog/releases{/id}","created_at":"2015-12-16T20:47:50Z","updated_at":"2015-12-16T20:47:51Z","pushed_at":"2015-12-28T16:03:12Z","git_url":"git://github.com/DevMike/Theblog.git","ssh_url":"git@github.com:DevMike/Theblog.git","clone_url":"https://github.com/DevMike/Theblog.git","svn_url":"https://github.com/DevMike/Theblog","homepage":"","size":200,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"kont-noor:master","ref":"master","sha":"79c720011dfc0d824d291cb195114cff9edb8b4c","user":{"login":"kont-noor","id":559035,"avatar_url":"https://avatars.githubusercontent.com/u/559035?v=3","gravatar_id":"","url":"https://api.github.com/users/kont-noor","html_url":"https://github.com/kont-noor","followers_url":"https://api.github.com/users/kont-noor/followers","following_url":"https://api.github.com/users/kont-noor/following{/other_user}","gists_url":"https://api.github.com/users/kont-noor/gists{/gist_id}","starred_url":"https://api.github.com/users/kont-noor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kont-noor/subscriptions","organizations_url":"https://api.github.com/users/kont-noor/orgs","repos_url":"https://api.github.com/users/kont-noor/repos","events_url":"https://api.github.com/users/kont-noor/events{/privacy}","received_events_url":"https://api.github.com/users/kont-noor/received_events","type":"User","site_admin":false},"repo":{"id":24800460,"name":"Theblog","full_name":"kont-noor/Theblog","owner":{"login":"kont-noor","id":559035,"avatar_url":"https://avatars.githubusercontent.com/u/559035?v=3","gravatar_id":"","url":"https://api.github.com/users/kont-noor","html_url":"https://github.com/kont-noor","followers_url":"https://api.github.com/users/kont-noor/followers","following_url":"https://api.github.com/users/kont-noor/following{/other_user}","gists_url":"https://api.github.com/users/kont-noor/gists{/gist_id}","starred_url":"https://api.github.com/users/kont-noor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kont-noor/subscriptions","organizations_url":"https://api.github.com/users/kont-noor/orgs","repos_url":"https://api.github.com/users/kont-noor/repos","events_url":"https://api.github.com/users/kont-noor/events{/privacy}","received_events_url":"https://api.github.com/users/kont-noor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kont-noor/Theblog","description":"Default blogging engine for most purposes","fork":false,"url":"https://api.github.com/repos/kont-noor/Theblog","forks_url":"https://api.github.com/repos/kont-noor/Theblog/forks","keys_url":"https://api.github.com/repos/kont-noor/Theblog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kont-noor/Theblog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kont-noor/Theblog/teams","hooks_url":"https://api.github.com/repos/kont-noor/Theblog/hooks","issue_events_url":"https://api.github.com/repos/kont-noor/Theblog/issues/events{/number}","events_url":"https://api.github.com/repos/kont-noor/Theblog/events","assignees_url":"https://api.github.com/repos/kont-noor/Theblog/assignees{/user}","branches_url":"https://api.github.com/repos/kont-noor/Theblog/branches{/branch}","tags_url":"https://api.github.com/repos/kont-noor/Theblog/tags","blobs_url":"https://api.github.com/repos/kont-noor/Theblog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kont-noor/Theblog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kont-noor/Theblog/git/refs{/sha}","trees_url":"https://api.github.com/repos/kont-noor/Theblog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kont-noor/Theblog/statuses/{sha}","languages_url":"https://api.github.com/repos/kont-noor/Theblog/languages","stargazers_url":"https://api.github.com/repos/kont-noor/Theblog/stargazers","contributors_url":"https://api.github.com/repos/kont-noor/Theblog/contributors","subscribers_url":"https://api.github.com/repos/kont-noor/Theblog/subscribers","subscription_url":"https://api.github.com/repos/kont-noor/Theblog/subscription","commits_url":"https://api.github.com/repos/kont-noor/Theblog/commits{/sha}","git_commits_url":"https://api.github.com/repos/kont-noor/Theblog/git/commits{/sha}","comments_url":"https://api.github.com/repos/kont-noor/Theblog/comments{/number}","issue_comment_url":"https://api.github.com/repos/kont-noor/Theblog/issues/comments{/number}","contents_url":"https://api.github.com/repos/kont-noor/Theblog/contents/{+path}","compare_url":"https://api.github.com/repos/kont-noor/Theblog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kont-noor/Theblog/merges","archive_url":"https://api.github.com/repos/kont-noor/Theblog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kont-noor/Theblog/downloads","issues_url":"https://api.github.com/repos/kont-noor/Theblog/issues{/number}","pulls_url":"https://api.github.com/repos/kont-noor/Theblog/pulls{/number}","milestones_url":"https://api.github.com/repos/kont-noor/Theblog/milestones{/number}","notifications_url":"https://api.github.com/repos/kont-noor/Theblog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kont-noor/Theblog/labels{/name}","releases_url":"https://api.github.com/repos/kont-noor/Theblog/releases{/id}","created_at":"2014-10-04T20:14:36Z","updated_at":"2015-12-04T15:40:37Z","pushed_at":"2015-12-28T22:28:21Z","git_url":"git://github.com/kont-noor/Theblog.git","ssh_url":"git@github.com:kont-noor/Theblog.git","clone_url":"https://github.com/kont-noor/Theblog.git","svn_url":"https://github.com/kont-noor/Theblog","homepage":"","size":219,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kont-noor/Theblog/pulls/34"},"html":{"href":"https://github.com/kont-noor/Theblog/pull/34"},"issue":{"href":"https://api.github.com/repos/kont-noor/Theblog/issues/34"},"comments":{"href":"https://api.github.com/repos/kont-noor/Theblog/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/kont-noor/Theblog/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/kont-noor/Theblog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kont-noor/Theblog/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/kont-noor/Theblog/statuses/250cfc0e5c835d088b3510e47abc4a71dd8d0125"}}}}