Deal.associate! can associate contacts and companies in a single call#120
Conversation
|
The existing interface for this API is a bit weird (mostly due to the API limitations) and I wouldn't have expected the behavior given it takes two arguments and ignores one of them. I see the reasoning behind your change and I think it makes sense for what the expected behavior would be. Unfortunately the PR as it is may break backwards compatibility because it changes the API calls. Since the HubSpot API only allows a single object type to be associated for each request, the library should also mimic this behavior. With that said, we can provide a wrapper function that does what you're doing here in calling the API twice, once for each object type. Instead of adding the other functions, can you make a single wrapper function that calls If you can do that, I'll get this merged and released. Thanks. |
|
Replaced by #210 |
Currently, if someone calls
Deal.associate(deal_id, [company_id], [contact_vid]), it only associates the company to the deal.This fix allows to associate both of them, using two API calls.
Also I didn't find any spec for
Deal.associate!so here's a bonus 😄