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

Fix Rollbar::JSON #321

Merged
merged 5 commits into from
Oct 19, 2015
Merged

Fix Rollbar::JSON #321

merged 5 commits into from
Oct 19, 2015

Conversation

jondeandres
Copy link
Contributor

No description provided.

godfat and others added 5 commits October 9, 2015 00:19
Whenever Yajl is used for MultiJson, before this patch,
Rollbar would find ::Yajl instead of Rollbar::JSON::Yajl,
and ::Yajl does exist but it does not respond to `options`,
causing failures.

It's surprising that Rollbar::JSON.const_get(:Yajl) would
find ::Yajl instead, it's like using Rollbar::JSON::Yajl to
refer to ::Yajl, this is really unfortunate for Ruby.
But given current status, we cannot rely on const_get in
this case. Therefore we'll need to search on constants
instead.

This has another advantage -- we no longer need to rescue,
saving an exception.
Passing inherit = false we ensure we only find constants in the passed module.
jondeandres added a commit that referenced this pull request Oct 19, 2015
@jondeandres jondeandres merged commit 4f6d569 into master Oct 19, 2015
@jondeandres jondeandres deleted the fix/json-const-get branch October 19, 2015 17:27
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.

2 participants