Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Deal.update and Deal.update! #209

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fonji
Copy link
Contributor

@fonji fonji commented Nov 8, 2019

It is possible to use Contact.update!(id, params) or Company.update!(id, params).
This adds the same functionnality for Deal.

I tried using updatable_resource, sadly Deal seems to be a bit weird…
This is a first step, as it uses the same signatures.

@fonji fonji mentioned this pull request Nov 8, 2019
Hubspot::Connection.put_json(UPDATE_DEAL_PATH, params: { deal_id: deal_id }, body: query)
@properties.merge!(params)
self
end
alias_method :update, :update!
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

paving the way to switch to Hubspot::Resource

@@ -3,6 +3,7 @@
let(:company_id) { 8954037 }
let(:vid) { 27136 }
let(:amount) { '30' }
let(:deal) { Hubspot::Deal.create!(portal_id, [company_id], [vid], { amount: amount}) }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this allowed a little clean up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant