{"action":"created","comment":{"url":"https://api.github.com/repos/wolox-training/mc-rails/pulls/comments/77821400","id":77821400,"diff_hunk":"@@ -0,0 +1,26 @@\n+class ApplicationPolicy\n+  attr_reader :user, :record\n+\n+  def initialize(user, record)\n+    @user = user\n+    @record = record\n+  end\n+\n+  def update?\n+    owner?\n+  end\n+\n+  def edit?\n+    update?\n+  end\n+\n+  def destroy?\n+    owner?\n+  end\n+\n+  private\n+\n+  def owner?\n+    @user == @record.user","path":"app/policies/application_policy.rb","position":24,"original_position":24,"commit_id":"4175fac22e5024bc3e150ff61d9a209f303d4428","original_commit_id":"4175fac22e5024bc3e150ff61d9a209f303d4428","user":{"login":"epintos","id":1047402,"avatar_url":"https://avatars.githubusercontent.com/u/1047402?v=3","gravatar_id":"","url":"https://api.github.com/users/epintos","html_url":"https://github.com/epintos","followers_url":"https://api.github.com/users/epintos/followers","following_url":"https://api.github.com/users/epintos/following{/other_user}","gists_url":"https://api.github.com/users/epintos/gists{/gist_id}","starred_url":"https://api.github.com/users/epintos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epintos/subscriptions","organizations_url":"https://api.github.com/users/epintos/orgs","repos_url":"https://api.github.com/users/epintos/repos","events_url":"https://api.github.com/users/epintos/events{/privacy}","received_events_url":"https://api.github.com/users/epintos/received_events","type":"User","site_admin":false},"body":"here you can use `user == record.user` because you have an attr_reader, that means you have getters now","created_at":"2016-09-07T13:29:49Z","updated_at":"2016-09-07T13:29:49Z","html_url":"https://github.com/wolox-training/mc-rails/pull/13#discussion_r77821400","pull_request_url":"https://api.github.com/repos/wolox-training/mc-rails/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/wolox-training/mc-rails/pulls/comments/77821400"},"html":{"href":"https://github.com/wolox-training/mc-rails/pull/13#discussion_r77821400"},"pull_request":{"href":"https://api.github.com/repos/wolox-training/mc-rails/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/wolox-training/mc-rails/pulls/13","id":84202273,"html_url":"https://github.com/wolox-training/mc-rails/pull/13","diff_url":"https://github.com/wolox-training/mc-rails/pull/13.diff","patch_url":"https://github.com/wolox-training/mc-rails/pull/13.patch","issue_url":"https://api.github.com/repos/wolox-training/mc-rails/issues/13","number":13,"state":"open","locked":false,"title":"Added - Pundit configuration.","user":{"login":"MatiasComercio","id":9677633,"avatar_url":"https://avatars.githubusercontent.com/u/9677633?v=3","gravatar_id":"","url":"https://api.github.com/users/MatiasComercio","html_url":"https://github.com/MatiasComercio","followers_url":"https://api.github.com/users/MatiasComercio/followers","following_url":"https://api.github.com/users/MatiasComercio/following{/other_user}","gists_url":"https://api.github.com/users/MatiasComercio/gists{/gist_id}","starred_url":"https://api.github.com/users/MatiasComercio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatiasComercio/subscriptions","organizations_url":"https://api.github.com/users/MatiasComercio/orgs","repos_url":"https://api.github.com/users/MatiasComercio/repos","events_url":"https://api.github.com/users/MatiasComercio/events{/privacy}","received_events_url":"https://api.github.com/users/MatiasComercio/received_events","type":"User","site_admin":false},"body":"# Summary\r\n- Users have now access to edit or delete only what they own. Pundit gem is used for this purpose.\r\n- Updated tests to match the new configurations.\r\n\r\n# Trello Card\r\nhttps://trello.com/c/oIJvmthY/16-instalar-y-configurar-pundit","created_at":"2016-09-06T21:46:41Z","updated_at":"2016-09-07T13:29:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ebdec5cbf4d3b45232e23d048cb5b2594ad08c4","assignee":{"login":"epintos","id":1047402,"avatar_url":"https://avatars.githubusercontent.com/u/1047402?v=3","gravatar_id":"","url":"https://api.github.com/users/epintos","html_url":"https://github.com/epintos","followers_url":"https://api.github.com/users/epintos/followers","following_url":"https://api.github.com/users/epintos/following{/other_user}","gists_url":"https://api.github.com/users/epintos/gists{/gist_id}","starred_url":"https://api.github.com/users/epintos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epintos/subscriptions","organizations_url":"https://api.github.com/users/epintos/orgs","repos_url":"https://api.github.com/users/epintos/repos","events_url":"https://api.github.com/users/epintos/events{/privacy}","received_events_url":"https://api.github.com/users/epintos/received_events","type":"User","site_admin":false},"assignees":[{"login":"epintos","id":1047402,"avatar_url":"https://avatars.githubusercontent.com/u/1047402?v=3","gravatar_id":"","url":"https://api.github.com/users/epintos","html_url":"https://github.com/epintos","followers_url":"https://api.github.com/users/epintos/followers","following_url":"https://api.github.com/users/epintos/following{/other_user}","gists_url":"https://api.github.com/users/epintos/gists{/gist_id}","starred_url":"https://api.github.com/users/epintos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epintos/subscriptions","organizations_url":"https://api.github.com/users/epintos/orgs","repos_url":"https://api.github.com/users/epintos/repos","events_url":"https://api.github.com/users/epintos/events{/privacy}","received_events_url":"https://api.github.com/users/epintos/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/wolox-training/mc-rails/pulls/13/commits","review_comments_url":"https://api.github.com/repos/wolox-training/mc-rails/pulls/13/comments","review_comment_url":"https://api.github.com/repos/wolox-training/mc-rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wolox-training/mc-rails/issues/13/comments","statuses_url":"https://api.github.com/repos/wolox-training/mc-rails/statuses/4175fac22e5024bc3e150ff61d9a209f303d4428","head":{"label":"wolox-training:pundit","ref":"pundit","sha":"4175fac22e5024bc3e150ff61d9a209f303d4428","user":{"login":"wolox-training","id":14113351,"avatar_url":"https://avatars.githubusercontent.com/u/14113351?v=3","gravatar_id":"","url":"https://api.github.com/users/wolox-training","html_url":"https://github.com/wolox-training","followers_url":"https://api.github.com/users/wolox-training/followers","following_url":"https://api.github.com/users/wolox-training/following{/other_user}","gists_url":"https://api.github.com/users/wolox-training/gists{/gist_id}","starred_url":"https://api.github.com/users/wolox-training/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolox-training/subscriptions","organizations_url":"https://api.github.com/users/wolox-training/orgs","repos_url":"https://api.github.com/users/wolox-training/repos","events_url":"https://api.github.com/users/wolox-training/events{/privacy}","received_events_url":"https://api.github.com/users/wolox-training/received_events","type":"Organization","site_admin":false},"repo":{"id":65819769,"name":"mc-rails","full_name":"wolox-training/mc-rails","owner":{"login":"wolox-training","id":14113351,"avatar_url":"https://avatars.githubusercontent.com/u/14113351?v=3","gravatar_id":"","url":"https://api.github.com/users/wolox-training","html_url":"https://github.com/wolox-training","followers_url":"https://api.github.com/users/wolox-training/followers","following_url":"https://api.github.com/users/wolox-training/following{/other_user}","gists_url":"https://api.github.com/users/wolox-training/gists{/gist_id}","starred_url":"https://api.github.com/users/wolox-training/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolox-training/subscriptions","organizations_url":"https://api.github.com/users/wolox-training/orgs","repos_url":"https://api.github.com/users/wolox-training/repos","events_url":"https://api.github.com/users/wolox-training/events{/privacy}","received_events_url":"https://api.github.com/users/wolox-training/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wolox-training/mc-rails","description":"Training M.C.","fork":false,"url":"https://api.github.com/repos/wolox-training/mc-rails","forks_url":"https://api.github.com/repos/wolox-training/mc-rails/forks","keys_url":"https://api.github.com/repos/wolox-training/mc-rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wolox-training/mc-rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wolox-training/mc-rails/teams","hooks_url":"https://api.github.com/repos/wolox-training/mc-rails/hooks","issue_events_url":"https://api.github.com/repos/wolox-training/mc-rails/issues/events{/number}","events_url":"https://api.github.com/repos/wolox-training/mc-rails/events","assignees_url":"https://api.github.com/repos/wolox-training/mc-rails/assignees{/user}","branches_url":"https://api.github.com/repos/wolox-training/mc-rails/branches{/branch}","tags_url":"https://api.github.com/repos/wolox-training/mc-rails/tags","blobs_url":"https://api.github.com/repos/wolox-training/mc-rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wolox-training/mc-rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wolox-training/mc-rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/wolox-training/mc-rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wolox-training/mc-rails/statuses/{sha}","languages_url":"https://api.github.com/repos/wolox-training/mc-rails/languages","stargazers_url":"https://api.github.com/repos/wolox-training/mc-rails/stargazers","contributors_url":"https://api.github.com/repos/wolox-training/mc-rails/contributors","subscribers_url":"https://api.github.com/repos/wolox-training/mc-rails/subscribers","subscription_url":"https://api.github.com/repos/wolox-training/mc-rails/subscription","commits_url":"https://api.github.com/repos/wolox-training/mc-rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/wolox-training/mc-rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/wolox-training/mc-rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/wolox-training/mc-rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/wolox-training/mc-rails/contents/{+path}","compare_url":"https://api.github.com/repos/wolox-training/mc-rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wolox-training/mc-rails/merges","archive_url":"https://api.github.com/repos/wolox-training/mc-rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wolox-training/mc-rails/downloads","issues_url":"https://api.github.com/repos/wolox-training/mc-rails/issues{/number}","pulls_url":"https://api.github.com/repos/wolox-training/mc-rails/pulls{/number}","milestones_url":"https://api.github.com/repos/wolox-training/mc-rails/milestones{/number}","notifications_url":"https://api.github.com/repos/wolox-training/mc-rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wolox-training/mc-rails/labels{/name}","releases_url":"https://api.github.com/repos/wolox-training/mc-rails/releases{/id}","deployments_url":"https://api.github.com/repos/wolox-training/mc-rails/deployments","created_at":"2016-08-16T12:49:24Z","updated_at":"2016-08-23T18:50:42Z","pushed_at":"2016-09-06T21:46:42Z","git_url":"git://github.com/wolox-training/mc-rails.git","ssh_url":"git@github.com:wolox-training/mc-rails.git","clone_url":"https://github.com/wolox-training/mc-rails.git","svn_url":"https://github.com/wolox-training/mc-rails","homepage":null,"size":1408,"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":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"wolox-training:article_owner","ref":"article_owner","sha":"bfa834b184aaa74ce335cfda5e4de4b8eaf5ea23","user":{"login":"wolox-training","id":14113351,"avatar_url":"https://avatars.githubusercontent.com/u/14113351?v=3","gravatar_id":"","url":"https://api.github.com/users/wolox-training","html_url":"https://github.com/wolox-training","followers_url":"https://api.github.com/users/wolox-training/followers","following_url":"https://api.github.com/users/wolox-training/following{/other_user}","gists_url":"https://api.github.com/users/wolox-training/gists{/gist_id}","starred_url":"https://api.github.com/users/wolox-training/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolox-training/subscriptions","organizations_url":"https://api.github.com/users/wolox-training/orgs","repos_url":"https://api.github.com/users/wolox-training/repos","events_url":"https://api.github.com/users/wolox-training/events{/privacy}","received_events_url":"https://api.github.com/users/wolox-training/received_events","type":"Organization","site_admin":false},"repo":{"id":65819769,"name":"mc-rails","full_name":"wolox-training/mc-rails","owner":{"login":"wolox-training","id":14113351,"avatar_url":"https://avatars.githubusercontent.com/u/14113351?v=3","gravatar_id":"","url":"https://api.github.com/users/wolox-training","html_url":"https://github.com/wolox-training","followers_url":"https://api.github.com/users/wolox-training/followers","following_url":"https://api.github.com/users/wolox-training/following{/other_user}","gists_url":"https://api.github.com/users/wolox-training/gists{/gist_id}","starred_url":"https://api.github.com/users/wolox-training/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolox-training/subscriptions","organizations_url":"https://api.github.com/users/wolox-training/orgs","repos_url":"https://api.github.com/users/wolox-training/repos","events_url":"https://api.github.com/users/wolox-training/events{/privacy}","received_events_url":"https://api.github.com/users/wolox-training/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wolox-training/mc-rails","description":"Training M.C.","fork":false,"url":"https://api.github.com/repos/wolox-training/mc-rails","forks_url":"https://api.github.com/repos/wolox-training/mc-rails/forks","keys_url":"https://api.github.com/repos/wolox-training/mc-rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wolox-training/mc-rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wolox-training/mc-rails/teams","hooks_url":"https://api.github.com/repos/wolox-training/mc-rails/hooks","issue_events_url":"https://api.github.com/repos/wolox-training/mc-rails/issues/events{/number}","events_url":"https://api.github.com/repos/wolox-training/mc-rails/events","assignees_url":"https://api.github.com/repos/wolox-training/mc-rails/assignees{/user}","branches_url":"https://api.github.com/repos/wolox-training/mc-rails/branches{/branch}","tags_url":"https://api.github.com/repos/wolox-training/mc-rails/tags","blobs_url":"https://api.github.com/repos/wolox-training/mc-rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wolox-training/mc-rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wolox-training/mc-rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/wolox-training/mc-rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wolox-training/mc-rails/statuses/{sha}","languages_url":"https://api.github.com/repos/wolox-training/mc-rails/languages","stargazers_url":"https://api.github.com/repos/wolox-training/mc-rails/stargazers","contributors_url":"https://api.github.com/repos/wolox-training/mc-rails/contributors","subscribers_url":"https://api.github.com/repos/wolox-training/mc-rails/subscribers","subscription_url":"https://api.github.com/repos/wolox-training/mc-rails/subscription","commits_url":"https://api.github.com/repos/wolox-training/mc-rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/wolox-training/mc-rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/wolox-training/mc-rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/wolox-training/mc-rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/wolox-training/mc-rails/contents/{+path}","compare_url":"https://api.github.com/repos/wolox-training/mc-rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wolox-training/mc-rails/merges","archive_url":"https://api.github.com/repos/wolox-training/mc-rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wolox-training/mc-rails/downloads","issues_url":"https://api.github.com/repos/wolox-training/mc-rails/issues{/number}","pulls_url":"https://api.github.com/repos/wolox-training/mc-rails/pulls{/number}","milestones_url":"https://api.github.com/repos/wolox-training/mc-rails/milestones{/number}","notifications_url":"https://api.github.com/repos/wolox-training/mc-rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wolox-training/mc-rails/labels{/name}","releases_url":"https://api.github.com/repos/wolox-training/mc-rails/releases{/id}","deployments_url":"https://api.github.com/repos/wolox-training/mc-rails/deployments","created_at":"2016-08-16T12:49:24Z","updated_at":"2016-08-23T18:50:42Z","pushed_at":"2016-09-06T21:46:42Z","git_url":"git://github.com/wolox-training/mc-rails.git","ssh_url":"git@github.com:wolox-training/mc-rails.git","clone_url":"https://github.com/wolox-training/mc-rails.git","svn_url":"https://github.com/wolox-training/mc-rails","homepage":null,"size":1408,"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":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wolox-training/mc-rails/pulls/13"},"html":{"href":"https://github.com/wolox-training/mc-rails/pull/13"},"issue":{"href":"https://api.github.com/repos/wolox-training/mc-rails/issues/13"},"comments":{"href":"https://api.github.com/repos/wolox-training/mc-rails/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/wolox-training/mc-rails/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/wolox-training/mc-rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wolox-training/mc-rails/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/wolox-training/mc-rails/statuses/4175fac22e5024bc3e150ff61d9a209f303d4428"}}}}
{"actor":{"display_login":"epintos"}}