{"action":"created","issue":{"url":"https://api.github.com/repos/adelevie/parse-ruby-client/issues/215","repository_url":"https://api.github.com/repos/adelevie/parse-ruby-client","labels_url":"https://api.github.com/repos/adelevie/parse-ruby-client/issues/215/labels{/name}","comments_url":"https://api.github.com/repos/adelevie/parse-ruby-client/issues/215/comments","events_url":"https://api.github.com/repos/adelevie/parse-ruby-client/issues/215/events","html_url":"https://github.com/adelevie/parse-ruby-client/issues/215","id":194709775,"number":215,"title":"client.query - error client is undefined method in the contoller","user":{"login":"OpConTech","id":2111943,"avatar_url":"https://avatars.githubusercontent.com/u/2111943?v=3","gravatar_id":"","url":"https://api.github.com/users/OpConTech","html_url":"https://github.com/OpConTech","followers_url":"https://api.github.com/users/OpConTech/followers","following_url":"https://api.github.com/users/OpConTech/following{/other_user}","gists_url":"https://api.github.com/users/OpConTech/gists{/gist_id}","starred_url":"https://api.github.com/users/OpConTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpConTech/subscriptions","organizations_url":"https://api.github.com/users/OpConTech/orgs","repos_url":"https://api.github.com/users/OpConTech/repos","events_url":"https://api.github.com/users/OpConTech/events{/privacy}","received_events_url":"https://api.github.com/users/OpConTech/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-09T22:12:55Z","updated_at":"2016-12-11T20:56:52Z","closed_at":null,"body":"I have been using v0.3 for a long time and a typical query like this works great:\r\n\r\n          videos_query = Parse::Query.new(\"Videos\").tap do |q|\r\n          #q.eq(\"UserTagID\", current_user.UserTagID)\r\n          q.eq(\"CompanyTag\", current_user.CompanyTag)\r\n          q.eq(\"videoPrivacy\", 'No')\r\n          q.order_by = \"-videoCreatedAt\"\r\n          q.limit = 1000 \r\n          @results = q.get\r\n          end.get\r\n\r\nNow I have migrated to parse server and so have been trying to use the latest version from the master branch so as to be able to specify my Parse Server URI.\r\n\r\nThe new documentation seems to show replacing Parse::Query.new with client.query. However when I do that it crashes the controller because client is an undefined method. \r\n\r\nAny suggestions would be much appreciated, \r\n\r\nTom"},"comment":{"url":"https://api.github.com/repos/adelevie/parse-ruby-client/issues/comments/266307289","html_url":"https://github.com/adelevie/parse-ruby-client/issues/215#issuecomment-266307289","issue_url":"https://api.github.com/repos/adelevie/parse-ruby-client/issues/215","id":266307289,"user":{"login":"OpConTech","id":2111943,"avatar_url":"https://avatars.githubusercontent.com/u/2111943?v=3","gravatar_id":"","url":"https://api.github.com/users/OpConTech","html_url":"https://github.com/OpConTech","followers_url":"https://api.github.com/users/OpConTech/followers","following_url":"https://api.github.com/users/OpConTech/following{/other_user}","gists_url":"https://api.github.com/users/OpConTech/gists{/gist_id}","starred_url":"https://api.github.com/users/OpConTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpConTech/subscriptions","organizations_url":"https://api.github.com/users/OpConTech/orgs","repos_url":"https://api.github.com/users/OpConTech/repos","events_url":"https://api.github.com/users/OpConTech/events{/privacy}","received_events_url":"https://api.github.com/users/OpConTech/received_events","type":"User","site_admin":false},"created_at":"2016-12-11T20:56:52Z","updated_at":"2016-12-11T20:56:52Z","body":"Thanks rhymes. Based on your feedback I have the queries working now. \r\n\r\nOne more quick question to help me finish the transition from 0.3 to 1.0.0 alpa. \r\nI have been defining current_user in the application_controller.rb as:\r\n\r\n----------- application_controller.rb------------------\r\n  private  \r\n  def current_user  \r\n    @current_user ||= User.find(session[:user_id]) if session[:user_id]\r\n  end \r\n// Note User.find  is from the old parse-resource gem\r\n\r\nBut I am having trouble getting this to work correctly in v.1.0.0 alpha because when I try:\r\n  @current_user ||= Parse::User.find(session[:user_id]) if session[:user_id]\r\nthe compiler lets make know that Parse::User in v1.0 does not have a .find method.\r\n\r\nAny chance you might know a good way to define a global @current_user in v1.0?"}}
{"actor":{"display_login":"OpConTech"}}