Skip to content

Support hashes with string keys #319

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

Merged
merged 2 commits into from
Oct 3, 2019
Merged

Support hashes with string keys #319

merged 2 commits into from
Oct 3, 2019

Conversation

mhenrixon
Copy link
Contributor

@mhenrixon mhenrixon commented May 15, 2019

Before this change the only way I could find to access a hash with string keys
was to either convert it to a symbol hash or define methods in the entity.

This should at least allow the entire hash to be accessed with string keys yet default to existing behavior (symbol keys).

If anyone has suggestions for how to improve this I'm all ears. This was just the quickest least intrusive thing I could think of at the time.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 95.857% when pulling 6aeab06 on mhenrixon:master into 1443468 on ruby-grape:master.

@coveralls
Copy link

coveralls commented May 15, 2019

Coverage Status

Coverage decreased (-0.2%) to 95.857% when pulling e07c29d on mhenrixon:master into 1443468 on ruby-grape:master.

@grape-bot
Copy link

grape-bot commented May 15, 2019

1 Error
🚫 One of the lines below found in CHANGELOG.md doesn’t match the expected format. Please make it look like the other lines, pay attention to periods and spaces.
* [#307](https://github.com/ruby-grape/grape-entity/pull/307): Allow exposures to call methods defined in modules included in an entity [@robertoz-01](https://github.com/robertoz-01).

Generated by 🚫 danger

mhenrixon added 2 commits May 15, 2019 18:19
Before this change the only way I could find to access a hash with string keys
was to either convert it to a symbol hash or define methods in the entity.

This should at least allow the entire hash to be accessed with string keys yet default to existing behaviour (symbol keys).
@LeFnord
Copy link
Member

LeFnord commented Oct 3, 2019

thanks @mhenrixon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants