Skip to content

Commit b85f41b

Browse files
committed
Add support to all db: tasks in the Rails command
Closes #640.
1 parent c51c83b commit b85f41b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/spring/client/rails.rb

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ def call
2222

2323
if COMMANDS.include?(command_name)
2424
Run.call(["rails_#{command_name}", *args.drop(2)])
25+
elsif command_name.start_with?("db:")
26+
Run.call(["rake", *args.drop(1)])
2527
else
2628
require "spring/configuration"
2729
ARGV.shift

test/support/acceptance_test.rb

+6
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,12 @@ def exec_name
630630
app.env["DISABLE_SPRING"] = "1"
631631
refute_output_includes "bin/rails runner ''", stderr: "WARN"
632632
end
633+
634+
test "rails db:migrate" do
635+
assert_speedup do
636+
2.times { app.run "bin/rails db:migrate" }
637+
end
638+
end
633639
end
634640
end
635641
end

0 commit comments

Comments
 (0)