From d215c76bc98aaf9d466805e1e6da87c2cae2eaaa Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Tue, 10 Mar 2020 12:23:14 +0100 Subject: [PATCH] Make it even more explicit the action is dangerous We're yelling at the person to make a backup before proceeding. --- lib/tasks/data/truncate_data.rake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/tasks/data/truncate_data.rake b/lib/tasks/data/truncate_data.rake index c5e9985b3d..ef01918205 100644 --- a/lib/tasks/data/truncate_data.rake +++ b/lib/tasks/data/truncate_data.rake @@ -35,10 +35,12 @@ namespace :ofn do def warn_with_confirmation message = <<-MSG.strip_heredoc \n - <%= color('This will permanently change DB contents. Please, make a backup first.', :yellow) %> + <% highlighted_message = "This will permanently change DB contents. Please, make a backup first." %> + <%= color(highlighted_message, :blink, :on_red) %> Are you sure you want to proceed? (y/N) MSG - exit unless HighLine.new.agree(message) { |q| q.default = "n" } + + exit unless HighLine.new.agree(message) { |q| q.default = "N" } end end end