ruby-grape / grape-entity

An API focused facade that sits on top of an object model.
MIT License
721 stars 153 forks source link

Support hashes with string keys #319

Closed mhenrixon closed 5 years ago

mhenrixon commented 5 years ago

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 commented 5 years ago

Coverage Status

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

coveralls commented 5 years ago

Coverage Status

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

grape-bot commented 5 years ago
1 Error
:no_entry_sign: 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 :no_entry_sign: danger

LeFnord commented 5 years ago

thanks @mhenrixon