diff --git a/guides/source/6_1_release_notes.md b/guides/source/6_1_release_notes.md index 06bec6696f..a8c46ad007 100644 --- a/guides/source/6_1_release_notes.md +++ b/guides/source/6_1_release_notes.md @@ -33,7 +33,9 @@ Please refer to the [Changelog][railties] for detailed changes. ### Removals -* Remove depreated `rake notes` tasks. +* Remove deprecated `rake notes` tasks. + +* Remove deprecated `connection` option in the `rails dbconsole` command. ### Deprecations diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index fb6df7ca1a..7dfd4168ac 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,3 +1,7 @@ +* Remove deprecated `connection` option in the `rails dbconsole` command. + + *Rafael Mendonça França* + * Remove depreated `rake notes` tasks. *Rafael Mendonça França* diff --git a/railties/lib/rails/commands/dbconsole/dbconsole_command.rb b/railties/lib/rails/commands/dbconsole/dbconsole_command.rb index 6d91e9e221..57aeac755a 100644 --- a/railties/lib/rails/commands/dbconsole/dbconsole_command.rb +++ b/railties/lib/rails/commands/dbconsole/dbconsole_command.rb @@ -168,9 +168,6 @@ module Rails class_option :header, type: :boolean - class_option :connection, aliases: "-c", type: :string, - desc: "Specifies the connection to use." - class_option :database, aliases: "--db", type: :string, desc: "Specifies the database to use." @@ -180,13 +177,6 @@ module Rails # RAILS_ENV needs to be set before config/application is required. ENV["RAILS_ENV"] = options[:environment] - if options["connection"] - ActiveSupport::Deprecation.warn(<<-MSG.squish) - `connection` option is deprecated and will be removed in Rails 6.1. Please use `database` option instead. - MSG - options["database"] = options["connection"] - end - require_application_and_environment! Rails::DBConsole.start(options) end diff --git a/railties/test/commands/dbconsole_test.rb b/railties/test/commands/dbconsole_test.rb index fcf90af8b9..eb83e1c272 100644 --- a/railties/test/commands/dbconsole_test.rb +++ b/railties/test/commands/dbconsole_test.rb @@ -246,18 +246,6 @@ class Rails::DBConsoleTest < ActiveSupport::TestCase end end - def test_connection_options_is_deprecate - command = Rails::Command::DbconsoleCommand.new([], ["-c", "custom"]) - Rails::DBConsole.stub(:start, nil) do - assert_deprecated("`connection` option is deprecated") do - command.perform - end - end - - assert_equal "custom", command.options["connection"] - assert_equal "custom", command.options["database"] - end - def test_print_help_short stdout = capture(:stdout) do Rails::Command.invoke(:dbconsole, ["-h"])