qpowell/google_places

BUG GooglePlaces::Client#spot of 0.24.0

smntkm opened this issue · 5 comments

Thank you for making this gem.

With a GooglePlaces::Clinet#spot of 0.24.0, error occurs.

ex.
clinet = GooglePlaces::Client.new(API_KEY, true)
client.spot('Cp...69w')
=> GooglePlaces::InvalidRequestError: GooglePlaces::InvalidRequestError
from google_places-0.24.0/lib/google_places/request.rb:325:in `parsed_response'

Please a fix.

Hi @smntkm, I'm not sure why this fails for you; I cannot reproduce the issue:

client = GooglePlaces::Client.new(API_KEY)
id = client.spots(-33.8670522, 151.1957362).first.place_id
client.spot(id).name
=> "Pyrmont"

Hi @marceldegraaf, Thank you for reply.
I also and try the above code, data was able to get.
But, the same error came out in reference.
forgot to say the attribute to get, sorry.

client = GooglePlaces::Client.new(API_KEY)
reference = client.spots(-33.8670522, 151.1957362).first.reference
client.spot(reference)
=> GooglePlaces::InvalidRequestError: GooglePlaces::InvalidRequestError
from google_places-0.24.0/lib/google_places/request.rb:325:in `parsed_response'

Hi @smntkm, I see what happens. But it is expected, because you can only use the place_id as parameter to client.spot(), not the reference.

Hi @marceldegraaf, I was wrong.
I'm sorry.
From now on, I will use the palce_id.
Thank you.

No problem! 😊