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

Disable Hashie warnings for re-defined methods such as length #295

Merged
merged 1 commit into from Apr 3, 2017
Merged

Disable Hashie warnings for re-defined methods such as length #295

merged 1 commit into from Apr 3, 2017

Conversation

janraasch
Copy link
Contributor

Description of the issue fixed by this pr

When using hashie >= v3.5.0 any Client#describe call currently results in lots of

You are setting a key that conflicts with a built-in method Restforce::Mash#length defined in Hash. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.

warnings, bc. of the fields-Array as fields have a length key.

Background

The logging layer of Hashie was introduced in hashie v3.5.0. And the disable_warnings method was introduced in hashie v3.5.2. See https://github.com/intridea/hashie/blob/master/CHANGELOG.md.

Other gems using hashie went this way as well, see for example elastic/elasticsearch-rails#666.

Any `Client#describe` class currently results in lots of

```
You are setting a key that conflicts with a built-in method Restforce::Mash#length defined in Hash. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
```

warnings, bc. of the “fields”-Array as “fields” have a “length” key.

The logging layer of Hashie was introduced in `hashie v3.5.0`. And the disable_warnings method was introduced in `hashie v3.5.2`. See https://github.com/intridea/hashie/blob/master/CHANGELOG.md
@timrogers
Copy link
Collaborator

👍

@timrogers timrogers merged commit c080890 into restforce:master Apr 3, 2017
@janraasch janraasch deleted the feature/silent-hashie branch April 3, 2017 12:07
timrogers pushed a commit that referenced this pull request Apr 3, 2017
* Ensure `Restforce::Middleware::Logger` is the last Faraday middleware to be called so everything is properly logged (including the effects of the `Gzip` and `CustomHeaders` middlewares which were previously running after it) (@jonnymacs)
* Suppress [Hashie](https://github.com/intridea/hashie) warnings when using Hashie v3.5.0 or later (see [#295](#295) for details) (@janraasch)
risenforward pushed a commit to risenforward/sfapi20 that referenced this pull request Dec 21, 2018
* Ensure `Restforce::Middleware::Logger` is the last Faraday middleware to be called so everything is properly logged (including the effects of the `Gzip` and `CustomHeaders` middlewares which were previously running after it) (@jonnymacs)
* Suppress [Hashie](https://github.com/intridea/hashie) warnings when using Hashie v3.5.0 or later (see [#295](restforce/restforce#295) for details) (@janraasch)
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.

None yet

2 participants