{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/513","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/513/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/513/comments","events_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/513/events","html_url":"https://github.com/ga-wdi-boston/full-stack-project/issues/513","id":192905481,"number":513,"title":"Issue with update after enabling current_user","user":{"login":"kibs86","id":16957330,"avatar_url":"https://avatars.githubusercontent.com/u/16957330?v=3","gravatar_id":"","url":"https://api.github.com/users/kibs86","html_url":"https://github.com/kibs86","followers_url":"https://api.github.com/users/kibs86/followers","following_url":"https://api.github.com/users/kibs86/following{/other_user}","gists_url":"https://api.github.com/users/kibs86/gists{/gist_id}","starred_url":"https://api.github.com/users/kibs86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kibs86/subscriptions","organizations_url":"https://api.github.com/users/kibs86/orgs","repos_url":"https://api.github.com/users/kibs86/repos","events_url":"https://api.github.com/users/kibs86/events{/privacy}","received_events_url":"https://api.github.com/users/kibs86/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-01T17:06:05Z","updated_at":"2016-12-01T17:28:47Z","closed_at":null,"body":"I tried to enable current_user for update by looking at the example controller, but whenever I try to update, I get a 404.  The update was working fine before doing the current_user check.\r\n\r\n**Rails request details from terminal:**\r\n```\r\nStarted PATCH \"/words/1\" for ::1 at 2016-12-01 12:00:39 -0500\r\nProcessing by WordsController#update as */*\r\n  Parameters: {\"word\"=>{\"word\"=>\"hello\", \"difficulty\"=>\"medium\"}, \"id\"=>\"1\"}\r\n  User Load (0.3ms)  SELECT  \"users\".* FROM \"users\" WHERE \"users\".\"token\" = $1 LIMIT 1  [[\"token\", \"a5d2c0c12d2908b568d103f3c0a9d5d2\"]]\r\n  Word Load (0.2ms)  SELECT  \"words\".* FROM \"words\" INNER JOIN \"completed_words\" ON \"words\".\"id\" = \"completed_words\".\"word_id\" WHERE \"completed_words\".\"user_id\" = $1 AND \"words\".\"id\" = $2 LIMIT 1  [[\"user_id\", 2], [\"id\", 1]]\r\n[active_model_serializers] Rendered ActiveModel::Serializer::Null with Hash (0.06ms)\r\nCompleted 404 Not Found in 8ms (Views: 1.0ms | ActiveRecord: 1.0ms)\r\n```\r\n\r\n**Controller action for update** (including before_action)\r\n```rb\r\nbefore_action :set_word, only: [:show, :update, :destroy]\r\n\r\ndef set_word\r\n    @word = current_user.words.find(params[:id])\r\n  end\r\n\r\ndef update\r\n    if @word.update(word_params)\r\n      # head :no_content\r\n      render json: base_query\r\n    else\r\n      render json: @word.errors, status: :unprocessable_entity\r\n    end\r\n  end\r\n```"},"comment":{"url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/comments/264237607","html_url":"https://github.com/ga-wdi-boston/full-stack-project/issues/513#issuecomment-264237607","issue_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/513","id":264237607,"user":{"login":"gaand","id":10064043,"avatar_url":"https://avatars.githubusercontent.com/u/10064043?v=3","gravatar_id":"","url":"https://api.github.com/users/gaand","html_url":"https://github.com/gaand","followers_url":"https://api.github.com/users/gaand/followers","following_url":"https://api.github.com/users/gaand/following{/other_user}","gists_url":"https://api.github.com/users/gaand/gists{/gist_id}","starred_url":"https://api.github.com/users/gaand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaand/subscriptions","organizations_url":"https://api.github.com/users/gaand/orgs","repos_url":"https://api.github.com/users/gaand/repos","events_url":"https://api.github.com/users/gaand/events{/privacy}","received_events_url":"https://api.github.com/users/gaand/received_events","type":"User","site_admin":false},"created_at":"2016-12-01T17:28:47Z","updated_at":"2016-12-01T17:28:47Z","body":"Is the action intended for `words` or `completed_words`?"}}
{"actor":{"display_login":"gaand"}}