-
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
OPTIONS - Generic Object Definition #42
Conversation
403a228
to
443fdac
Compare
This LGTM!! Thanks @AparnaKarve for the enhancement. /cc @jntullo can I borrow your 👀 for a quick review ? |
This pull request is not mergeable. Please rebase and repush. |
@AparnaKarve will need a rebase/repush when you get a chance. Thanks. |
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! |
443fdac
to
7b99575
Compare
Return allowed associated classes and types
7b99575
to
91c5338
Compare
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.
@AparnaKarve this LGTM. Just one suggestion - do you think that allowed_association_types
and allowed_types
could be centralized (possibly in the model) so that you don't have to reproduce the implementation in the tests? I'm fine with leaving that as a follow up if you'd rather get this merged first
@imtayadeway I did think about adding In normal course (pre-API days), we would have implemented That was mainly the rationale behind adding the methods in |
@AparnaKarve is that because you didn't want it to be executed at load time? Aren't there ways to delay it until call time? Either way, if you didn't want to update the model, you could add a service object instead? |
@imtayadeway If we add the methods to the model, we probably do not have to worry about delayed loading etc. It should just work. @abellotti Can you please merge this and I can create a follow-up PR to move the methods
Not sure how applicable the service object is to this case. |
I'm ok with keeping those here, but still not crazy with the dup. As an option (no pun intended), why not just define those as class instance methods for now.
and used by both api controller and specs. |
@abellotti When I make those methods as class instance methods, they work in the api controller when I access them like this - GenericObjectDefinitionsController::allowed_association_types But
|
0c49419
to
eb05cd3
Compare
to remove method duplication in the spec
eb05cd3
to
9cfe639
Compare
Checked commits AparnaKarve/manageiq-api@9b87724~...9cfe639 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@abellotti Thanks for the tip on class instance method and |
I like that there are no dups now. Thanks @imtayadeway and @abellotti |
Thanks @AparnaKarve for the API enhancement !! will merge when 🍏 |
We need support for
OPTIONS /api/generic_object_definitions
so that the Generic Object Definitions UI populates the dropdowns with the allowedassociation types
and alloweddata types
Requires ManageIQ/manageiq#15922 to be merged first for the new Dictionary entries added for the allowed data types.