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

return correct custom_attributes href #14752

Merged
merged 2 commits into from
Apr 19, 2017
Merged

return correct custom_attributes href #14752

merged 2 commits into from
Apr 19, 2017

Conversation

jntullo
Copy link

@jntullo jntullo commented Apr 12, 2017

Performing an action, such as edit on custom_attributes returns an href that does not exist:

https://<address>/api/custom_attributes/:attribute_id

Custom attributes is not a collection and results in a not found when attempting to retrieve that object.

It should return an href with reference to the subcollection that is a custom attribute of.

Update: same issue was happening with tenant_quotas - added a spec to verify fix helped.

@miq-bot add_label wip, api, bug
@miq-bot assign @abellotti

@jntullo
Copy link
Author

jntullo commented Apr 13, 2017

@miq-bot remove_label wip

@jntullo jntullo changed the title [WIP] return correct custom_attributes href return correct custom_attributes href Apr 13, 2017
@miq-bot miq-bot removed the wip label Apr 13, 2017
@abellotti
Copy link
Member

Hi @jntullo I think normalize_href can simply be the following:

def normalize_href(type, value)
  type.to_s == @req.subcollection ? subcollection_href(type, value) : collection_href(type, value)
end

@jntullo
Copy link
Author

jntullo commented Apr 19, 2017

@abellotti yup, thanks! 😄

@miq-bot
Copy link
Member

miq-bot commented Apr 19, 2017

Checked commits jntullo/manageiq@9c77b3a~...6c2adb7 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
3 files checked, 0 offenses detected
Everything looks good. 🍰

@abellotti
Copy link
Member

Thanks @jntullo for updating and fixing this bug 😍 will merge when 🍏

@abellotti abellotti merged commit f6b90aa into ManageIQ:master Apr 19, 2017
@abellotti abellotti added this to the Sprint 59 Ending Apr 24, 2017 milestone Apr 19, 2017
@jntullo jntullo deleted the bz/custom_attributes_href branch November 28, 2017 19:41
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.

3 participants