From 98f1090e7a3c4f2536753f07ee00b3d131bab2a9 Mon Sep 17 00:00:00 2001 From: Rune Philosof Date: Thu, 26 May 2022 09:59:21 +0200 Subject: [PATCH] `rails runner` instead of `rails c` rails console prints some tty-related errors when not connected to a terminal (such as when running in a git hook). --- bin/git_rails | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/git_rails b/bin/git_rails index 9854d47..e1744ae 100755 --- a/bin/git_rails +++ b/bin/git_rails @@ -155,7 +155,7 @@ if [ ! -z "$migrations" ]; then # RUN THE MIGRATIONS (AND TEST PREPARE) { - echo "$migrate_commands" | bundle exec rails c + echo "$migrate_commands" | bundle exec rails runner /dev/stdin } > $out_target # CLEAN UP DOWN MIGRATIONS