From 48b249927375465a7102acc71c2dfb8d49af8309 Mon Sep 17 00:00:00 2001 From: Robin Dupret Date: Fri, 9 Jun 2017 00:15:41 +0200 Subject: Deprecate environment as an argument for dbconsole and console People should rather rely on the `-e` or `--environment` options to specify in which environment they want to work. This will allow us to specify the connection to pick as a regular argument in the future. --- railties/lib/rails/command/environment_argument.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'railties/lib') diff --git a/railties/lib/rails/command/environment_argument.rb b/railties/lib/rails/command/environment_argument.rb index 05eac34155..3469463db5 100644 --- a/railties/lib/rails/command/environment_argument.rb +++ b/railties/lib/rails/command/environment_argument.rb @@ -13,6 +13,12 @@ module Rails def extract_environment_option_from_argument if environment self.options = options.merge(environment: acceptable_environment(environment)) + + ActiveSupport::Deprecation.warn "Passing the environment's name as a " \ + "regular argument is deprecated and " \ + "will be removed in the next Rails " \ + "version. Please, use the -e option " \ + "instead." elsif !options[:environment] self.options = options.merge(environment: Rails::Command.environment) end -- cgit v1.2.3