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

Adds remove_approver_resource to ServiceRequestController. #13596

Merged

Conversation

cynepco3hahue
Copy link

Desription

Adds remove_approver_resource to ServiceRequestController.

Links

Pivotal ticket

service_request.miq_approvals.find_by(:approver_name => user.name).destroy
end
rescue => err
raise BadRequestError, "Cannot remove approver - #{err}"
Copy link
Member

Choose a reason for hiding this comment

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

if the user is not an approver, the error message may not be nice, i.e. Cannot remove approver - undefined method `destroy' for nil:NilClass. Please check that case and simply not do the destroy (i.e. should just be a success since the user is not an approver). Thanks.

Copy link
Author

Choose a reason for hiding this comment

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

👍

@abellotti
Copy link
Member

could you also take care of the rubocop warning ? Thanks!!

@cynepco3hahue cynepco3hahue force-pushed the API_service_request_remove_approver branch from cfcc18d to 7131726 Compare January 22, 2017 14:03
@miq-bot
Copy link
Member

miq-bot commented Jan 22, 2017

Checked commit cynepco3hahue@7131726 with ruby 2.2.6, rubocop 0.46.0, and haml-lint 0.19.0
2 files checked, 0 offenses detected
Everything looks good. 👍

@abellotti
Copy link
Member

LGTM!! Thanks for the API enhancement.

@abellotti abellotti merged commit 1822971 into ManageIQ:master Jan 23, 2017
@abellotti abellotti added this to the Sprint 53 Ending Jan 30, 2017 milestone Jan 23, 2017
@cynepco3hahue cynepco3hahue deleted the API_service_request_remove_approver branch January 24, 2017 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants