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

always add geocoder to Rack::Request if defined #1085

Merged
merged 1 commit into from Aug 19, 2016

Conversation

wjordan
Copy link
Contributor

@wjordan wjordan commented Aug 19, 2016

Ever since the code change in #1061, if a Rack application loads both Rails and Sinatra simultaneously (e.g., both are included in the same middleware stack for handling different routes), then only ActionDispatch::Request will be enhanced with geocoder methods and not Rack::Request, causing request#location to be undefined in the Sinatra route. (My use-case is currently Rails 4.2, but presumably affects Rails 5 as well.)

The fix in this PR changes the if ... elsif conditional to instead use two separate conditionals.

wjordan added a commit to code-dot-org/code-dot-org that referenced this pull request Aug 19, 2016
@TrangPham TrangPham merged commit 07aeeab into alexreisner:master Aug 19, 2016
@TrangPham
Copy link
Contributor

Thanks for this!

I don't think that including in both with cause an issue.

aceunreal pushed a commit to aceunreal/geocoder that referenced this pull request Sep 28, 2016
ChangsoonKim pushed a commit to ChangsoonKim/geocoder that referenced this pull request Nov 23, 2017
zacviandier pushed a commit to teezily/geocoder that referenced this pull request Feb 9, 2018
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