Change commands to not depend on ARGV
Follow-up to #38463. This commit changes additional command classes to not depend on prior ARGV contents.
This commit is contained in:
parent
51d73fb84b
commit
373ad2c624
@ -10,8 +10,13 @@ module System
|
||||
class ChangeCommand < Base # :nodoc:
|
||||
class_option :to, desc: "The database system to switch to."
|
||||
|
||||
def initialize(positional_args, option_args, *)
|
||||
@argv = positional_args + option_args
|
||||
super
|
||||
end
|
||||
|
||||
def perform
|
||||
Rails::Generators::Db::System::ChangeGenerator.start
|
||||
Rails::Generators::Db::System::ChangeGenerator.start(@argv)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -29,8 +29,8 @@ def help
|
||||
def perform(*)
|
||||
$LOAD_PATH << Rails::Command.root.join("test").to_s
|
||||
|
||||
Rails::TestUnit::Runner.parse_options(ARGV)
|
||||
Rails::TestUnit::Runner.run(ARGV)
|
||||
Rails::TestUnit::Runner.parse_options(args)
|
||||
Rails::TestUnit::Runner.run(args)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -123,9 +123,8 @@ def api_only!
|
||||
template_engine: nil
|
||||
)
|
||||
|
||||
if ARGV.first == "mailer"
|
||||
options[:rails][:template_engine] = :erb
|
||||
end
|
||||
options[:mailer] ||= {}
|
||||
options[:mailer][:template_engine] ||= :erb
|
||||
end
|
||||
|
||||
# Returns an array of generator namespaces that are hidden.
|
||||
|
Loading…
Reference in New Issue
Block a user