aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2019-01-25 00:07:33 +0100
committerGitHub <noreply@github.com>2019-01-25 00:07:33 +0100
commit5f7d5995a65d97f2592213889672e9c4799556ec (patch)
tree57f86259e136d70bcda53006c3dd51522b144402 /railties/lib/rails
parent1b7f0283b939773bdc91730f8b0494e37d469de9 (diff)
parenta39aa99c8145e6782bffa1effd4f3678cab6b794 (diff)
downloadrails-5f7d5995a65d97f2592213889672e9c4799556ec.tar.gz
rails-5f7d5995a65d97f2592213889672e9c4799556ec.tar.bz2
rails-5f7d5995a65d97f2592213889672e9c4799556ec.zip
Merge pull request #34789 from christos/fix-editing-new-environment-credentials
Don't load app environment when editing credentials
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/command/actions.rb10
-rw-r--r--railties/lib/rails/commands/credentials/credentials_command.rb4
2 files changed, 12 insertions, 2 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
diff --git a/railties/lib/rails/commands/credentials/credentials_command.rb b/railties/lib/rails/commands/credentials/credentials_command.rb
index 852cd401d7..54ccd97506 100644
--- a/railties/lib/rails/commands/credentials/credentials_command.rb
+++ b/railties/lib/rails/commands/credentials/credentials_command.rb
@@ -20,7 +20,7 @@ module Rails
end
def edit
- require_application_and_environment!
+ require_application!
ensure_editor_available(command: "bin/rails credentials:edit") || (return)
@@ -37,7 +37,7 @@ module Rails
end
def show
- require_application_and_environment!
+ require_application!
say credentials.read.presence || missing_credentials_message
end