Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Don't load app environment when editing credentials #34789
While evaluating multi-environment credentials, I came across a problem trying to create a new environment for my app.
Once you have created your first environment (e.g.
# config/initializers/sidekiq.rb Sidekiq::Web.set :session_secret, Rails.application.credentials.secret_key_base!
That works fine when running
If you now decide to create a
A great many gems that access 3rd party APIs use an initialiser for configuring credentials so the above situation is quite likely to occur.
I worked around the issue by creating a new empty Rails app, running
This PR attempts to fix the issue by not loading the application environment for
I've added a test but I am not sure that it is correct (or sufficient) as I struggled to fully understand the railties test harness. Happy to try another way to test this.