-
Notifications
You must be signed in to change notification settings - Fork 143
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
API calls to fetch and update the Automate Workspace #21
Conversation
Depends on ManageIQ/manageiq#15817 and |
Travis failure is because of the other PR's not being merged |
current_output = obj.output || {} | ||
obj.output = current_output.deep_merge(data) | ||
obj.save | ||
obj |
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.
None of this belongs in a controller. The api controllers should be stupid, and the model should have all of this "how to patch an atuomate workspace" knowledge.
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.
👍 model/business logic stays in model.
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.
The api controllers should be stupid
❤️ ❤️ ❤️
@@ -18,7 +18,7 @@ def edit_resource(_type, id, data = {}) | |||
if obj.nil? | |||
raise NotFoundError, "Invalid Workspace #{id} specified" | |||
end | |||
obj.update_output(data) | |||
obj.output = data |
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.
do we need a begin/rescue here ?
Hi! It looks like your PR has been affected by the recently merged #40, and as a result will need to be rebased. First, I apologize for any inconvenience caused. After rebasing, you'll need to update some specs in order for them to pass. In particular you'll need to change any path helpers, applying the following pattern:
If you run into any issues, please ping me and I will try to help you out. Many thanks! |
This pull request is not mergeable. Please rebase and repush. |
8ea19c3
to
4cfc887
Compare
Checked commits mkanoor/manageiq-api@b999edd~...b04eccf with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
LGTM!! We'll update this once we have the update in the base to support arbitrary resource identifier (i.e. guid instead of id). |
Added API calls to fetch and update the Automate Workspace.
Each Automate Workspace has a unique GUID and they can be only retrieved using the GUID.