-
Notifications
You must be signed in to change notification settings - Fork 185
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
Support batch update resources #344
Conversation
Failure specs will pass after #345. |
lib/zendesk_api/actions.rb
Outdated
# @param [Hash] attributes The attributes to update resources with | ||
# @return [JobStatus] the {JobStatus} instance for this destroy job | ||
def update_many!(client, ids, attributes) | ||
def update_many!(client, ids_or_attributes_array, attributes = {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ids_or_attributes_array
naming looks not good to me...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd leave off the _array ... and make attributes=nil
to mke the check simpler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me but L283 might need conditions.
@grosser Would you be able to review this also, please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good ... not sure how to make it simpler ... and the tests look good
let me know what you think of my suggestions ... looks good to merge either way |
I've left |
spec/core/bulk_actions_spec.rb
Outdated
@@ -47,22 +47,44 @@ | |||
subject { ZendeskAPI::BulkTestResource } | |||
|
|||
context "update_many!" do | |||
let(:attributes) { { :name => 'A', :age => 25 } } | |||
context "arity: 3" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updating a list of ids
spec/core/bulk_actions_spec.rb
Outdated
it 'returns a JobStatus' do | ||
expect(@response).to be_instance_of(ZendeskAPI::JobStatus) | ||
expect(@response.id).to eq('ghi') | ||
context "arity: 2" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updating with multiple attribute hashes
1.15.0 🎉 |
Thank you for your review! |
thx for some great PRs :)
…On Fri, Sep 8, 2017 at 8:45 PM, Hiroki Toyokawa ***@***.***> wrote:
Thank you for your review!
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#344 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAsZ1V3p9U4nayWQZ2Vhbtd7Gu5XzoQks5sggnJgaJpZM4PJ9E3>
.
|
Support batch update resources.
e.g. https://developer.zendesk.com/rest_api/docs/core/tickets#batch-updates