diff options
author | Robin Dupret <robin.dupret@gmail.com> | 2017-06-09 00:15:41 +0200 |
---|---|---|
committer | Robin Dupret <robin.dupret@gmail.com> | 2017-07-16 15:10:34 +0200 |
commit | 48b249927375465a7102acc71c2dfb8d49af8309 (patch) | |
tree | 9f4d2ec7e7dfe01eb67715945e4ccc4c0508375f /railties/lib | |
parent | 1acd9a6464668d4d54ab30d016829f60b70dbbeb (diff) | |
download | rails-48b249927375465a7102acc71c2dfb8d49af8309.tar.gz rails-48b249927375465a7102acc71c2dfb8d49af8309.tar.bz2 rails-48b249927375465a7102acc71c2dfb8d49af8309.zip |
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.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/command/environment_argument.rb | 6 |
1 files changed, 6 insertions, 0 deletions
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 |