aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/command
diff options
context:
space:
mode:
authorChristos Zisopoulos <christos@mac.com>2018-12-26 00:03:20 +0100
committerChristos Zisopoulos <christos@mac.com>2018-12-26 00:03:20 +0100
commita39aa99c8145e6782bffa1effd4f3678cab6b794 (patch)
tree85092f6e8a284e0a585ed9da6a0cb8e6e28e1c0c /railties/lib/rails/command
parent6a8519ca899db1b107bc3be8310e49196f341372 (diff)
downloadrails-a39aa99c8145e6782bffa1effd4f3678cab6b794.tar.gz
rails-a39aa99c8145e6782bffa1effd4f3678cab6b794.tar.bz2
rails-a39aa99c8145e6782bffa1effd4f3678cab6b794.zip
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.
Diffstat (limited to 'railties/lib/rails/command')
-rw-r--r--railties/lib/rails/command/actions.rb10
1 files changed, 10 insertions, 0 deletions
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