{"action":"created","comment":{"url":"https://api.github.com/repos/diaspora/diaspora/pulls/comments/38406601","id":38406601,"diff_hunk":"@@ -17,6 +18,14 @@ def self.add_admin(person)\n     find_or_create_by(person_id: person.id, name: \"admin\")\n   end\n \n+  def self.moderator?(person)\n+    exists?(person_id: person.id, name: \"moderator\")","path":"app/models/role.rb","position":22,"original_position":22,"commit_id":"76e533efe245c6b35ede933b46f7809314653f9c","original_commit_id":"76e533efe245c6b35ede933b46f7809314653f9c","user":{"login":"jhass","id":141294,"avatar_url":"https://avatars.githubusercontent.com/u/141294?v=3","gravatar_id":"","url":"https://api.github.com/users/jhass","html_url":"https://github.com/jhass","followers_url":"https://api.github.com/users/jhass/followers","following_url":"https://api.github.com/users/jhass/following{/other_user}","gists_url":"https://api.github.com/users/jhass/gists{/gist_id}","starred_url":"https://api.github.com/users/jhass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhass/subscriptions","organizations_url":"https://api.github.com/users/jhass/orgs","repos_url":"https://api.github.com/users/jhass/repos","events_url":"https://api.github.com/users/jhass/events{/privacy}","received_events_url":"https://api.github.com/users/jhass/received_events","type":"User","site_admin":false},"body":"And then three specs would be awesome, `expect(Role.moderator?(admin_person)).to be_true`, `expect(Role.moderator?(moderator_person)).to be_true`, `expect(Role.moderator?(normal_person)).to be_false`","created_at":"2015-09-01T10:54:22Z","updated_at":"2015-09-01T10:54:22Z","html_url":"https://github.com/diaspora/diaspora/pull/6351#discussion_r38406601","pull_request_url":"https://api.github.com/repos/diaspora/diaspora/pulls/6351","_links":{"self":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/comments/38406601"},"html":{"href":"https://github.com/diaspora/diaspora/pull/6351#discussion_r38406601"},"pull_request":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6351"}}},"pull_request":{"url":"https://api.github.com/repos/diaspora/diaspora/pulls/6351","id":43398414,"html_url":"https://github.com/diaspora/diaspora/pull/6351","diff_url":"https://github.com/diaspora/diaspora/pull/6351.diff","patch_url":"https://github.com/diaspora/diaspora/pull/6351.patch","issue_url":"https://api.github.com/repos/diaspora/diaspora/issues/6351","number":6351,"state":"open","locked":false,"title":"[WIP] 5324 create new role moderator","user":{"login":"zaziemo","id":2119496,"avatar_url":"https://avatars.githubusercontent.com/u/2119496?v=3","gravatar_id":"","url":"https://api.github.com/users/zaziemo","html_url":"https://github.com/zaziemo","followers_url":"https://api.github.com/users/zaziemo/followers","following_url":"https://api.github.com/users/zaziemo/following{/other_user}","gists_url":"https://api.github.com/users/zaziemo/gists{/gist_id}","starred_url":"https://api.github.com/users/zaziemo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zaziemo/subscriptions","organizations_url":"https://api.github.com/users/zaziemo/orgs","repos_url":"https://api.github.com/users/zaziemo/repos","events_url":"https://api.github.com/users/zaziemo/events{/privacy}","received_events_url":"https://api.github.com/users/zaziemo/received_events","type":"User","site_admin":false},"body":"The people who are assigned the moderator role should be able to see, mark and delete reported comments/posts. They also should get an email when a new post/comment is reported. Mostly everything works fine, only the email's language doesn't change according to the person's language settings (it takes the language settings of the first one). ","created_at":"2015-08-26T12:58:19Z","updated_at":"2015-09-01T10:54:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9c9262e976fde2756ee2d5df363e44f05bb7018","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/diaspora/diaspora/pulls/6351/commits","review_comments_url":"https://api.github.com/repos/diaspora/diaspora/pulls/6351/comments","review_comment_url":"https://api.github.com/repos/diaspora/diaspora/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diaspora/diaspora/issues/6351/comments","statuses_url":"https://api.github.com/repos/diaspora/diaspora/statuses/76e533efe245c6b35ede933b46f7809314653f9c","head":{"label":"TeamDeltaQuadrant:5324-create-new-role-moderator","ref":"5324-create-new-role-moderator","sha":"76e533efe245c6b35ede933b46f7809314653f9c","user":{"login":"TeamDeltaQuadrant","id":11795785,"avatar_url":"https://avatars.githubusercontent.com/u/11795785?v=3","gravatar_id":"","url":"https://api.github.com/users/TeamDeltaQuadrant","html_url":"https://github.com/TeamDeltaQuadrant","followers_url":"https://api.github.com/users/TeamDeltaQuadrant/followers","following_url":"https://api.github.com/users/TeamDeltaQuadrant/following{/other_user}","gists_url":"https://api.github.com/users/TeamDeltaQuadrant/gists{/gist_id}","starred_url":"https://api.github.com/users/TeamDeltaQuadrant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeamDeltaQuadrant/subscriptions","organizations_url":"https://api.github.com/users/TeamDeltaQuadrant/orgs","repos_url":"https://api.github.com/users/TeamDeltaQuadrant/repos","events_url":"https://api.github.com/users/TeamDeltaQuadrant/events{/privacy}","received_events_url":"https://api.github.com/users/TeamDeltaQuadrant/received_events","type":"Organization","site_admin":false},"repo":{"id":38496047,"name":"diaspora","full_name":"TeamDeltaQuadrant/diaspora","owner":{"login":"TeamDeltaQuadrant","id":11795785,"avatar_url":"https://avatars.githubusercontent.com/u/11795785?v=3","gravatar_id":"","url":"https://api.github.com/users/TeamDeltaQuadrant","html_url":"https://github.com/TeamDeltaQuadrant","followers_url":"https://api.github.com/users/TeamDeltaQuadrant/followers","following_url":"https://api.github.com/users/TeamDeltaQuadrant/following{/other_user}","gists_url":"https://api.github.com/users/TeamDeltaQuadrant/gists{/gist_id}","starred_url":"https://api.github.com/users/TeamDeltaQuadrant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeamDeltaQuadrant/subscriptions","organizations_url":"https://api.github.com/users/TeamDeltaQuadrant/orgs","repos_url":"https://api.github.com/users/TeamDeltaQuadrant/repos","events_url":"https://api.github.com/users/TeamDeltaQuadrant/events{/privacy}","received_events_url":"https://api.github.com/users/TeamDeltaQuadrant/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TeamDeltaQuadrant/diaspora","description":"Distributed and contextual social networking","fork":true,"url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora","forks_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/forks","keys_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/teams","hooks_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/hooks","issue_events_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/issues/events{/number}","events_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/events","assignees_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/assignees{/user}","branches_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/branches{/branch}","tags_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/tags","blobs_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/git/refs{/sha}","trees_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/statuses/{sha}","languages_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/languages","stargazers_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/stargazers","contributors_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/contributors","subscribers_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/subscribers","subscription_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/subscription","commits_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/commits{/sha}","git_commits_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/git/commits{/sha}","comments_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/comments{/number}","issue_comment_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/issues/comments{/number}","contents_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/contents/{+path}","compare_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/merges","archive_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/downloads","issues_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/issues{/number}","pulls_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/pulls{/number}","milestones_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/milestones{/number}","notifications_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/labels{/name}","releases_url":"https://api.github.com/repos/TeamDeltaQuadrant/diaspora/releases{/id}","created_at":"2015-07-03T14:16:37Z","updated_at":"2015-07-03T14:16:41Z","pushed_at":"2015-09-01T09:40:15Z","git_url":"git://github.com/TeamDeltaQuadrant/diaspora.git","ssh_url":"git@github.com:TeamDeltaQuadrant/diaspora.git","clone_url":"https://github.com/TeamDeltaQuadrant/diaspora.git","svn_url":"https://github.com/TeamDeltaQuadrant/diaspora","homepage":"https://diasporafoundation.org/","size":101626,"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":"develop"}},"base":{"label":"diaspora:develop","ref":"develop","sha":"67df0a20eec2a2882fd40595dda9aa3edf78de51","user":{"login":"diaspora","id":293207,"avatar_url":"https://avatars.githubusercontent.com/u/293207?v=3","gravatar_id":"","url":"https://api.github.com/users/diaspora","html_url":"https://github.com/diaspora","followers_url":"https://api.github.com/users/diaspora/followers","following_url":"https://api.github.com/users/diaspora/following{/other_user}","gists_url":"https://api.github.com/users/diaspora/gists{/gist_id}","starred_url":"https://api.github.com/users/diaspora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diaspora/subscriptions","organizations_url":"https://api.github.com/users/diaspora/orgs","repos_url":"https://api.github.com/users/diaspora/repos","events_url":"https://api.github.com/users/diaspora/events{/privacy}","received_events_url":"https://api.github.com/users/diaspora/received_events","type":"Organization","site_admin":false},"repo":{"id":911765,"name":"diaspora","full_name":"diaspora/diaspora","owner":{"login":"diaspora","id":293207,"avatar_url":"https://avatars.githubusercontent.com/u/293207?v=3","gravatar_id":"","url":"https://api.github.com/users/diaspora","html_url":"https://github.com/diaspora","followers_url":"https://api.github.com/users/diaspora/followers","following_url":"https://api.github.com/users/diaspora/following{/other_user}","gists_url":"https://api.github.com/users/diaspora/gists{/gist_id}","starred_url":"https://api.github.com/users/diaspora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diaspora/subscriptions","organizations_url":"https://api.github.com/users/diaspora/orgs","repos_url":"https://api.github.com/users/diaspora/repos","events_url":"https://api.github.com/users/diaspora/events{/privacy}","received_events_url":"https://api.github.com/users/diaspora/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diaspora/diaspora","description":"Distributed and contextual social networking","fork":false,"url":"https://api.github.com/repos/diaspora/diaspora","forks_url":"https://api.github.com/repos/diaspora/diaspora/forks","keys_url":"https://api.github.com/repos/diaspora/diaspora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diaspora/diaspora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diaspora/diaspora/teams","hooks_url":"https://api.github.com/repos/diaspora/diaspora/hooks","issue_events_url":"https://api.github.com/repos/diaspora/diaspora/issues/events{/number}","events_url":"https://api.github.com/repos/diaspora/diaspora/events","assignees_url":"https://api.github.com/repos/diaspora/diaspora/assignees{/user}","branches_url":"https://api.github.com/repos/diaspora/diaspora/branches{/branch}","tags_url":"https://api.github.com/repos/diaspora/diaspora/tags","blobs_url":"https://api.github.com/repos/diaspora/diaspora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diaspora/diaspora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diaspora/diaspora/git/refs{/sha}","trees_url":"https://api.github.com/repos/diaspora/diaspora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diaspora/diaspora/statuses/{sha}","languages_url":"https://api.github.com/repos/diaspora/diaspora/languages","stargazers_url":"https://api.github.com/repos/diaspora/diaspora/stargazers","contributors_url":"https://api.github.com/repos/diaspora/diaspora/contributors","subscribers_url":"https://api.github.com/repos/diaspora/diaspora/subscribers","subscription_url":"https://api.github.com/repos/diaspora/diaspora/subscription","commits_url":"https://api.github.com/repos/diaspora/diaspora/commits{/sha}","git_commits_url":"https://api.github.com/repos/diaspora/diaspora/git/commits{/sha}","comments_url":"https://api.github.com/repos/diaspora/diaspora/comments{/number}","issue_comment_url":"https://api.github.com/repos/diaspora/diaspora/issues/comments{/number}","contents_url":"https://api.github.com/repos/diaspora/diaspora/contents/{+path}","compare_url":"https://api.github.com/repos/diaspora/diaspora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diaspora/diaspora/merges","archive_url":"https://api.github.com/repos/diaspora/diaspora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diaspora/diaspora/downloads","issues_url":"https://api.github.com/repos/diaspora/diaspora/issues{/number}","pulls_url":"https://api.github.com/repos/diaspora/diaspora/pulls{/number}","milestones_url":"https://api.github.com/repos/diaspora/diaspora/milestones{/number}","notifications_url":"https://api.github.com/repos/diaspora/diaspora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diaspora/diaspora/labels{/name}","releases_url":"https://api.github.com/repos/diaspora/diaspora/releases{/id}","created_at":"2010-09-15T05:20:04Z","updated_at":"2015-08-31T22:43:09Z","pushed_at":"2015-09-01T09:40:19Z","git_url":"git://github.com/diaspora/diaspora.git","ssh_url":"git@github.com:diaspora/diaspora.git","clone_url":"https://github.com/diaspora/diaspora.git","svn_url":"https://github.com/diaspora/diaspora","homepage":"https://diasporafoundation.org/","size":256154,"stargazers_count":10249,"watchers_count":10249,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2658,"mirror_url":null,"open_issues_count":418,"forks":2658,"open_issues":418,"watchers":10249,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6351"},"html":{"href":"https://github.com/diaspora/diaspora/pull/6351"},"issue":{"href":"https://api.github.com/repos/diaspora/diaspora/issues/6351"},"comments":{"href":"https://api.github.com/repos/diaspora/diaspora/issues/6351/comments"},"review_comments":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6351/comments"},"review_comment":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6351/commits"},"statuses":{"href":"https://api.github.com/repos/diaspora/diaspora/statuses/76e533efe245c6b35ede933b46f7809314653f9c"}}}}