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

Check for presence of Rails.env not just ::Rails #1003

Closed
wants to merge 4 commits into from

Conversation

wkrsz
Copy link
Contributor

@wkrsz wkrsz commented Oct 19, 2017

Sometimes Rails module is defined without Rails being loaded (e.g. rails-html-sanitizer defines this module). Instead let's check for Rails.env.

Solution taken from rails/activeresource#216

@wkrsz
Copy link
Contributor Author

wkrsz commented Oct 19, 2017

One item in the test matrix failed (https://travis-ci.org/airblade/paper_trail/builds/289990814). I can't retry the build on Travis but this combination is passing on my machine so I'm guessing it's a random error.

@jaredbeck
Copy link
Member

CI job #1516.11 restarted

@jaredbeck
Copy link
Member

rails/activeresource#216 checks for Rails.application, but this PR checks for Rails.env. Any difference?

like ActiveResource does
@wkrsz
Copy link
Contributor Author

wkrsz commented Oct 20, 2017

Ah, I saw Rails.env used in some other project. Let's go with Rails.application since that's what ActiveResource uses.

@jaredbeck
Copy link
Member

Looks good. Thanks, Wojtek.

Please add:

  1. A comment above the code explaining this change.
  2. An entry in CHANGELOG.md under Unreleased -> Fixed, with a link to this PR.

@jaredbeck
Copy link
Member

Closing via #1006 which preserves your authorship, and adds a warning instead of silently failing to load.

@jaredbeck jaredbeck closed this Oct 23, 2017
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