Closed fertobar closed 8 years ago
:+1:
Same problem when using google-ruby-client in service Google::Apis::AnalyticsV3::AnalyticsService with Rails 4.2.2 and ruby 2.2.1. but not in rails console
The problem appear when I do:
auth.update_token!({
access_token: session[:gauth]['access_token'],
refresh_token: session[:gauth]['refresh_token'],
expires_in: session[:gauth]['expires_in'],
issued_at: session[:gauth]['issued_at']
})
'issued_at' is store at session var as string and signet wait for a Time object. I have solved it doing:
auth.update_token!({
access_token: session[:gauth]['access_token'],
refresh_token: session[:gauth]['refresh_token'],
expires_in: session[:gauth]['expires_in'],
issued_at: Time.parse(session[:gauth]['issued_at'])
})
Maybe a extra control at @issued_at could avoid the error.
return (@issued_at.is_a? String ? Time.parse(@issued_at) : @issued_at ) + @expires_in
This issue IMHO is in google-adwords-api
. So you here is my PR fixing it https://github.com/Gataniel/google-api-ads-ruby/tree/fix-ads_common-saving-issued_at-as-a-string-instead-of-time
Should be fixed in 0.7
Hi. I'm using Rails 4, & ruby 2.1 and I'm getting this error in SOAP connection: no implicit conversion of Fixnum into String
More details: rails (4.1.0) faraday (0.9.1)
I notice that similar code works in Rails 3.2.20,and fails with Rails 4.1 , 4.2, and similar Rails 4
https://github.com/google/signet/blob/master/lib/signet/oauth_2/client.rb Line 748:
Related with issue: https://github.com/googleads/google-api-ads-ruby/issues/53#issuecomment-96950402
Any suggestion? thanks