From 6bfe66595e7185637a1975b85d660b0efcbb236d Mon Sep 17 00:00:00 2001 From: inayuky Date: Mon, 30 May 2022 13:40:00 +0900 Subject: [PATCH] Fix rails db:system:change command failure issue --- lib/spring/client/rails.rb | 2 +- test/support/acceptance_test.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/spring/client/rails.rb b/lib/spring/client/rails.rb index 626e9b9f..65b80049 100644 --- a/lib/spring/client/rails.rb +++ b/lib/spring/client/rails.rb @@ -20,7 +20,7 @@ def call if COMMANDS.include?(command_name) Run.call(["rails_#{command_name}", *args.drop(2)]) - elsif command_name&.start_with?("db:") + elsif command_name&.start_with?("db:") && !command_name.start_with?("db:system") Run.call(["rake", *args.drop(1)]) else require "spring/configuration" diff --git a/test/support/acceptance_test.rb b/test/support/acceptance_test.rb index 76d1628c..903d106f 100644 --- a/test/support/acceptance_test.rb +++ b/test/support/acceptance_test.rb @@ -702,6 +702,10 @@ def exec_name 2.times { app.run "bin/rails db:migrate" } end end + + test "rails db:system:change" do + assert_success "bin/rails db:system:change --to=sqlite3" + end end end end