doliveirakn / clio_client Goto Github PK
View Code? Open in Web Editor NEWA ruby client for Clio's API
Home Page: https://github.com/clio/clio_client
License: MIT License
A ruby client for Clio's API
Home Page: https://github.com/clio/clio_client
License: MIT License
Clio API supports the create action now.
clio_connect_email
needs to be added to contacts model and readonly, and default_email
as well nested under email_addresses
Are you planning on updating this gem for the upcoming V4 version of the API?
Add client connect permissions model and include the CRUD actions available from the API (index, create and destroy).
Was trying to create a resource, e.g.,
api.contacts.new(contact_params).save
Was receiving this error:
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
.
Where it appears to go wrong is in resource.rb:
def save
if self.id.nil?
saved_item = api.create(self.to_params)
self.id = saved_item && saved_item.id # Trying to assign 'false' to the 'id' attribute
self
else
api.update(self.id, self.to_params)
self
end
end
I can make a PR with some guidance on the expected behavior.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.