{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/743","repository_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project","labels_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/743/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/743/comments","events_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/743/events","html_url":"https://github.com/ga-wdi-boston/full-stack-project/issues/743","id":224901736,"number":743,"title":"Editable method in my serializer is not working","user":{"login":"jim-moody","id":26190589,"avatar_url":"https://avatars1.githubusercontent.com/u/26190589?v=3","gravatar_id":"","url":"https://api.github.com/users/jim-moody","html_url":"https://github.com/jim-moody","followers_url":"https://api.github.com/users/jim-moody/followers","following_url":"https://api.github.com/users/jim-moody/following{/other_user}","gists_url":"https://api.github.com/users/jim-moody/gists{/gist_id}","starred_url":"https://api.github.com/users/jim-moody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jim-moody/subscriptions","organizations_url":"https://api.github.com/users/jim-moody/orgs","repos_url":"https://api.github.com/users/jim-moody/repos","events_url":"https://api.github.com/users/jim-moody/events{/privacy}","received_events_url":"https://api.github.com/users/jim-moody/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-27T20:20:52Z","updated_at":"2017-04-27T20:33:15Z","closed_at":null,"body":"I am trying to take advantage of the \"editable\" method that I saw in the Examples serializer so I can determine if I should show/hide an Edit/Delete button in my client, but it does not appear to be working correctly.\r\n\r\nWhen I sign in with a user and create a new message, it does return editable=true which is correct.\r\n\r\nBut then if I refresh the page and sign in with that user again, all the messages in the database come back with editable=false which is incorrect because at least one of them belongs to that user.\r\n\r\nSerializer:\r\n```ruby\r\nclass LineSerializer < ActiveModel::Serializer\r\n  attributes :id, :text, :editable\r\n\r\n  def editable\r\n    scope == object.user\r\n  end\r\nend\r\n```\r\n\r\nResponse from API on POST:\r\n```js\r\nObject {id: 30, text: \"new line 2\", editable: true}\r\n```\r\n\r\nResponse from API on INDEX after logging in with same user that created above message:\r\n```js\r\nObject {id: 30, text: \"new line 2\", editable: false}\r\n```"},"comment":{"url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/comments/297831198","html_url":"https://github.com/ga-wdi-boston/full-stack-project/issues/743#issuecomment-297831198","issue_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/743","id":297831198,"user":{"login":"sdavidson140","id":13722245,"avatar_url":"https://avatars0.githubusercontent.com/u/13722245?v=3","gravatar_id":"","url":"https://api.github.com/users/sdavidson140","html_url":"https://github.com/sdavidson140","followers_url":"https://api.github.com/users/sdavidson140/followers","following_url":"https://api.github.com/users/sdavidson140/following{/other_user}","gists_url":"https://api.github.com/users/sdavidson140/gists{/gist_id}","starred_url":"https://api.github.com/users/sdavidson140/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdavidson140/subscriptions","organizations_url":"https://api.github.com/users/sdavidson140/orgs","repos_url":"https://api.github.com/users/sdavidson140/repos","events_url":"https://api.github.com/users/sdavidson140/events{/privacy}","received_events_url":"https://api.github.com/users/sdavidson140/received_events","type":"User","site_admin":false},"created_at":"2017-04-27T20:33:15Z","updated_at":"2017-04-27T20:33:15Z","body":"where are you setting the value of editable?"}}
{"actor":{"display_login":"sdavidson140"}}