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

Allow group settings with string keys #16142

Merged
merged 1 commit into from
Oct 11, 2017

Conversation

imtayadeway
Copy link
Contributor

This fixes an issue where settings are created/updated in the JSON
API, which has no notion of symbols as implemented by
Ruby. Consequently, these settings get ignored when looked up by
symbol. My solution was to override the settings method to return a
HashWithIndifferentAccess.

I am personally not a fan of HashWithIndifferentAccess, but
considered this the best of several options. Alternatives considered:

  • update everywhere that we might be sending hashes with string keys,
    convert them to symbols
  • override the setter to accept hashes with symbols or strings, but
    convert them to all symbols prior to writing.

I could be talked into one of these alternatives (or one I hadn't considered) if you have strong opinions ™️ about it.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1424842

@miq-bot add-label bug
@miq-bot assign @gtanzillo

This fixes an issue where settings are created/updated in the JSON
API, which has no notion of symbols as implemented by
Ruby. Consequently, these settings get ignored when looked up by
symbol. My solution was to override the `settings` method to return a
`HashWithIndifferentAccess`.

I am personally not a fan of `HashWithIndifferentAccess`, but
considered this the best of several options. Alternatives considered:

* update everywhere that we might be sending hashes with string keys,
  convert them to symbols
* override the setter to accept hashes with symbols or strings, but
  convert them to all symbols prior to writing.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1424842
@miq-bot
Copy link
Member

miq-bot commented Oct 6, 2017

Checked commit imtayadeway@c0a662b with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks fine. 🍪

Copy link
Member

@gtanzillo gtanzillo left a comment

Choose a reason for hiding this comment

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

👍

@gtanzillo gtanzillo added this to the Sprint 71 Ending Oct 16, 2017 milestone Oct 11, 2017
@gtanzillo gtanzillo merged commit 9c92f26 into ManageIQ:master Oct 11, 2017
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Dec 1, 2017
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Dec 1, 2017
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Dec 1, 2017
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Dec 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants