Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,13 @@ These files are loaded during the `before_configuration` callback, which is fire
# config/application.rb
Bundler.require(*Rails.groups)

# Load .env.local in test
Dotenv::Rails.files.unshift(".env.local") if ENV["RAILS_ENV"] == "test"
# Load .env.local in test, between .env.test.local and .env.test to match
# the precedence .env.local has in the other environments
if ENV["RAILS_ENV"] == "test"
files = Dotenv::Rails.files
index = files.index(".env.test.local")&.succ || files.index(".env.test") || 0
files.insert(index, ".env.local")
end

module YourApp
class Application < Rails::Application
Expand Down Expand Up @@ -334,4 +339,4 @@ If you want a better idea of how dotenv works, check out the [Ruby Rogues Code R
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
5. Create new Pull Request