{"action":"created","issue":{"url":"https://api.github.com/repos/fsek/web/issues/165","labels_url":"https://api.github.com/repos/fsek/web/issues/165/labels{/name}","comments_url":"https://api.github.com/repos/fsek/web/issues/165/comments","events_url":"https://api.github.com/repos/fsek/web/issues/165/events","html_url":"https://github.com/fsek/web/issues/165","id":69923777,"number":165,"title":"Post: Edit post","user":{"login":"davidwessman","id":6763624,"avatar_url":"https://avatars.githubusercontent.com/u/6763624?v=3","gravatar_id":"","url":"https://api.github.com/users/davidwessman","html_url":"https://github.com/davidwessman","followers_url":"https://api.github.com/users/davidwessman/followers","following_url":"https://api.github.com/users/davidwessman/following{/other_user}","gists_url":"https://api.github.com/users/davidwessman/gists{/gist_id}","starred_url":"https://api.github.com/users/davidwessman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidwessman/subscriptions","organizations_url":"https://api.github.com/users/davidwessman/orgs","repos_url":"https://api.github.com/users/davidwessman/repos","events_url":"https://api.github.com/users/davidwessman/events{/privacy}","received_events_url":"https://api.github.com/users/davidwessman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/fsek/web/labels/issue/bug","name":"issue/bug","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"davidwessman","id":6763624,"avatar_url":"https://avatars.githubusercontent.com/u/6763624?v=3","gravatar_id":"","url":"https://api.github.com/users/davidwessman","html_url":"https://github.com/davidwessman","followers_url":"https://api.github.com/users/davidwessman/followers","following_url":"https://api.github.com/users/davidwessman/following{/other_user}","gists_url":"https://api.github.com/users/davidwessman/gists{/gist_id}","starred_url":"https://api.github.com/users/davidwessman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidwessman/subscriptions","organizations_url":"https://api.github.com/users/davidwessman/orgs","repos_url":"https://api.github.com/users/davidwessman/repos","events_url":"https://api.github.com/users/davidwessman/events{/privacy}","received_events_url":"https://api.github.com/users/davidwessman/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-04-21T18:54:17Z","updated_at":"2015-04-23T12:57:28Z","closed_at":null,"body":"This line fails:\r\nhttps://github.com/fsek/web/blob/master/app/views/posts/edit.html.erb#L7\r\n\r\nShould be ```PermissionPost```, and we need an integration test for this.\r\nWill fix in next PR I finish.\r\n"},"comment":{"url":"https://api.github.com/repos/fsek/web/issues/comments/95576491","html_url":"https://github.com/fsek/web/issues/165#issuecomment-95576491","issue_url":"https://api.github.com/repos/fsek/web/issues/165","id":95576491,"user":{"login":"jforberg","id":1269005,"avatar_url":"https://avatars.githubusercontent.com/u/1269005?v=3","gravatar_id":"","url":"https://api.github.com/users/jforberg","html_url":"https://github.com/jforberg","followers_url":"https://api.github.com/users/jforberg/followers","following_url":"https://api.github.com/users/jforberg/following{/other_user}","gists_url":"https://api.github.com/users/jforberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jforberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jforberg/subscriptions","organizations_url":"https://api.github.com/users/jforberg/orgs","repos_url":"https://api.github.com/users/jforberg/repos","events_url":"https://api.github.com/users/jforberg/events{/privacy}","received_events_url":"https://api.github.com/users/jforberg/received_events","type":"User","site_admin":false},"created_at":"2015-04-23T12:57:28Z","updated_at":"2015-04-23T12:57:28Z","body":"Maybe you know this but to be clear:\r\n\r\n```\r\ncan? :modify, PermissionsPost\r\n```\r\n\r\nMeans 'is there *some* situation in which user would be able to modify *any* permissionspost'. So as long as the user can modify a single instance, under some set of conditions, this will be true. A common error is to think it means 'can user modify *all* permissionspost'.\r\n\r\nIt's always better to test against a specific instance if you have one. This is the way cancan is meant to be used. It's OK to make a new object just to test against, e.g. in this situation I would do:\r\n\r\n```\r\ncan? :modify, PermissionsPost.new(:post => @post)\r\n```\r\n\r\nWhich then answers the question, 'can user modify a permissionspost given that the post is @post'"}}