Remove deprecated connection
option in the rails dbconsole
command
This commit is contained in:
parent
227d04f46a
commit
8513769ad6
@ -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
|
||||
|
||||
|
@ -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*
|
||||
|
@ -168,9 +168,6 @@ class DbconsoleCommand < Base # :nodoc:
|
||||
|
||||
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 @@ def perform
|
||||
# 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
|
||||
|
@ -246,18 +246,6 @@ def test_specifying_a_missing_environment
|
||||
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"])
|
||||
|
Loading…
Reference in New Issue
Block a user