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

Do not assume environment from env var #844

Merged
merged 1 commit into from Aug 12, 2019

Conversation

xymbol
Copy link
Contributor

@xymbol xymbol commented Jun 27, 2019

This prevents an exception from being raised when RACK_ENV is used to set the environment or, when RAILS_ENV is unset. Also, this makes Clearance work with Suspenders which uses RACK_ENV in newly generated apps.

https://github.com/thoughtbot/suspenders/blob/75158c86797b19324d80027677ec45cd88af2b02/templates/rails_helper.rb#L1

This prevents an exception when `RACK_ENV` is used to set the environment or,
when `RAILS_ENV` is unset. See:
https://github.com/rails/rails/blob/b9ca94caea2ca6a6cc09abaffaad67b447134079/railties/lib/rails.rb#L73.
@xymbol
Copy link
Contributor Author

xymbol commented Aug 11, 2019

Wonder if someone is open to discuss this change. The current code is wrong and ignores the existing API. Please see: https://github.com/rails/rails/blob/b9ca94caea2ca6a6cc09abaffaad67b447134079/railties/lib/rails.rb#L72-L74. /cc @mjankowski

@mjankowski mjankowski merged commit 397fd7e into thoughtbot:master Aug 12, 2019
@mjankowski
Copy link
Contributor

Thanks for ping.

@xymbol xymbol deleted the back-door-fix branch August 13, 2019 12:53
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