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

Support batch update resources #344

Merged
merged 5 commits into from
Sep 9, 2017
Merged

Conversation

otoyo
Copy link
Contributor

@otoyo otoyo commented Sep 1, 2017

@otoyo
Copy link
Contributor Author

otoyo commented Sep 8, 2017

Failure specs will pass after #345.

@otoyo otoyo closed this Sep 9, 2017
@otoyo otoyo reopened this Sep 9, 2017
# @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 = {})
Copy link
Contributor Author

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...

Copy link
Contributor

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

Copy link
Contributor Author

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.

@otoyo
Copy link
Contributor Author

otoyo commented Sep 9, 2017

@grosser Would you be able to review this also, please?

Copy link
Contributor

@grosser grosser left a 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

@grosser
Copy link
Contributor

grosser commented Sep 9, 2017

let me know what you think of my suggestions ... looks good to merge either way

@otoyo
Copy link
Contributor Author

otoyo commented Sep 9, 2017

I've left _array.

@@ -47,22 +47,44 @@
subject { ZendeskAPI::BulkTestResource }

context "update_many!" do
let(:attributes) { { :name => 'A', :age => 25 } }
context "arity: 3" do
Copy link
Contributor

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

it 'returns a JobStatus' do
expect(@response).to be_instance_of(ZendeskAPI::JobStatus)
expect(@response.id).to eq('ghi')
context "arity: 2" do
Copy link
Contributor

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

@grosser grosser merged commit cfbba21 into zendesk:master Sep 9, 2017
@grosser
Copy link
Contributor

grosser commented Sep 9, 2017

1.15.0 🎉

@otoyo
Copy link
Contributor Author

otoyo commented Sep 9, 2017

Thank you for your review!

@grosser
Copy link
Contributor

grosser commented Sep 9, 2017 via email

@otoyo otoyo deleted the batch-update branch November 8, 2017 05:02
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.

2 participants