{"action":"created","issue":{"url":"https://api.github.com/repos/ryancwong8/blunt_api/issues/1","repository_url":"https://api.github.com/repos/ryancwong8/blunt_api","labels_url":"https://api.github.com/repos/ryancwong8/blunt_api/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/ryancwong8/blunt_api/issues/1/comments","events_url":"https://api.github.com/repos/ryancwong8/blunt_api/issues/1/events","html_url":"https://github.com/ryancwong8/blunt_api/issues/1","id":173157686,"number":1,"title":"No Method Error:","user":{"login":"noobiehacker","id":3968317,"avatar_url":"https://avatars.githubusercontent.com/u/3968317?v=3","gravatar_id":"","url":"https://api.github.com/users/noobiehacker","html_url":"https://github.com/noobiehacker","followers_url":"https://api.github.com/users/noobiehacker/followers","following_url":"https://api.github.com/users/noobiehacker/following{/other_user}","gists_url":"https://api.github.com/users/noobiehacker/gists{/gist_id}","starred_url":"https://api.github.com/users/noobiehacker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noobiehacker/subscriptions","organizations_url":"https://api.github.com/users/noobiehacker/orgs","repos_url":"https://api.github.com/users/noobiehacker/repos","events_url":"https://api.github.com/users/noobiehacker/events{/privacy}","received_events_url":"https://api.github.com/users/noobiehacker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-25T09:39:57Z","updated_at":"2016-08-29T07:06:36Z","closed_at":null,"body":"Not too sure if I am not calling it properly, but I am getting internal server error???\r\n\r\nNULL LIMIT 1\r\nUnpermitted parameter: seekingprofile\r\nCompleted 500 Internal Server Error in 3ms (ActiveRecord: 0.5ms)\r\n\r\nNoMethodError (undefined method `update' for nil:NilClass):\r\n  app/controllers/api/v1/users_controller.rb:55:in `get_filtered_users'\r\n\r\n\r\n```\r\n  def get_filtered_users\r\n    user = current_user\r\n\t\t#No method error?\r\n    user.update(user_params)\r\n    user.SeekingProfile.update(params.require(:user).permit(:seekingprofile_attributes => [:maxSeekDistance, :minSeekDistance]))\r\n    distance = user.SeekingProfile.maxSeekDistance - user.SeekingProfile.minSeekDistance\r\n    @users = User.within(distance, :units => :miles, :origin => [user.latitude, user.longitude]).by_distance(:origin => [user.latitude, user.longitude]).where.not(facebook_id: user.facebook_id)\r\n    render :json => @users\r\n  end\r\n```\r\n\r\nSee if this helps\r\n\r\nhttp://stackoverflow.com/questions/21927567/undefined-method-update-for-nil-class\r\n\r\n@ryancwong8 "},"comment":{"url":"https://api.github.com/repos/ryancwong8/blunt_api/issues/comments/243047851","html_url":"https://github.com/ryancwong8/blunt_api/issues/1#issuecomment-243047851","issue_url":"https://api.github.com/repos/ryancwong8/blunt_api/issues/1","id":243047851,"user":{"login":"ryancwong8","id":8270689,"avatar_url":"https://avatars.githubusercontent.com/u/8270689?v=3","gravatar_id":"","url":"https://api.github.com/users/ryancwong8","html_url":"https://github.com/ryancwong8","followers_url":"https://api.github.com/users/ryancwong8/followers","following_url":"https://api.github.com/users/ryancwong8/following{/other_user}","gists_url":"https://api.github.com/users/ryancwong8/gists{/gist_id}","starred_url":"https://api.github.com/users/ryancwong8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryancwong8/subscriptions","organizations_url":"https://api.github.com/users/ryancwong8/orgs","repos_url":"https://api.github.com/users/ryancwong8/repos","events_url":"https://api.github.com/users/ryancwong8/events{/privacy}","received_events_url":"https://api.github.com/users/ryancwong8/received_events","type":"User","site_admin":false},"created_at":"2016-08-29T07:06:36Z","updated_at":"2016-08-29T07:06:36Z","body":"Hey noobiehacker,\r\n\r\nI assume this error is occurring because current_user is null. This is because you must send authorization token in headers with the request. I will implement a more informative error message. Thanks"}}
{"actor":{"display_login":"ryancwong8"}}