You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 22, 2019. It is now read-only.
NoMethodError: undefined method `to_i' for false:FalseClass
Did you mean? to_s
from /app/vendor/bundle/ruby/2.3.0/gems/clio_client-0.1.9/lib/clio_client/resource.rb:164:in `convert_attribute'
from /app/vendor/bundle/ruby/2.3.0/gems/clio_client-0.1.9/lib/clio_client/resource.rb:55:in `block (2 levels) in set_attributes'
from /app/vendor/bundle/ruby/2.3.0/gems/clio_client-0.1.9/lib/clio_client/resource.rb:113:in `save'
from (irb):28
Turns out, there was an error in our code where we were accidentally populating the 'id' field of one of the contact's phone numbers, so Clio was returning a 'conflict' error which ClioClient initially manifests with a Net::HTTPConflict error. This error is rescued in http.rb and ClioClient::UnknownResponse is thrown in its place.
Then crudable.rb rescues UnknownResponse and returns false.
defsaveifself.id.nil?saved_item=api.create(self.to_params)self.id=saved_item && saved_item.id# Trying to assign 'false' to the 'id' attributeselfelseapi.update(self.id,self.to_params)selfendend
I can make a PR with some guidance on the expected behavior.
Was trying to create a resource, e.g.,
Was receiving this error:
Turns out, there was an error in our code where we were accidentally populating the 'id' field of one of the contact's phone numbers, so Clio was returning a 'conflict' error which ClioClient initially manifests with a Net::HTTPConflict error. This error is rescued in http.rb and ClioClient::UnknownResponse is thrown in its place.
Then crudable.rb rescues UnknownResponse and returns
false.Where it appears to go wrong is in resource.rb:
I can make a PR with some guidance on the expected behavior.