From a39aa99c8145e6782bffa1effd4f3678cab6b794 Mon Sep 17 00:00:00 2001 From: Christos Zisopoulos Date: Wed, 26 Dec 2018 00:03:20 +0100 Subject: Don't load app environment when editing credentials This avoids missing key exceptions caused by code that tries to read the credentials before they have been added to the encrypted file, for example when editing the credentials for a new environment. --- railties/lib/rails/command/actions.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'railties/lib/rails/command') diff --git a/railties/lib/rails/command/actions.rb b/railties/lib/rails/command/actions.rb index cbb743346b..50651ad61a 100644 --- a/railties/lib/rails/command/actions.rb +++ b/railties/lib/rails/command/actions.rb @@ -11,10 +11,20 @@ module Rails end def require_application_and_environment! + require_application! + require_environment! + end + + def require_application! require ENGINE_PATH if defined?(ENGINE_PATH) if defined?(APP_PATH) require APP_PATH + end + end + + def require_environment! + if defined?(APP_PATH) Rails.application.require_environment! end end -- cgit v1.2.3