From 958f3e5943a436d5cef3f14a8047cba6921bfae7 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Fri, 27 Feb 2026 15:31:34 -0500 Subject: [PATCH] Indicate squashing is in progress When squasher is running the rails app, set an environment variable that the Rails app can interrogate. This way the rails app can behave differently while squashing. For example, to disable any rake tasks (like rails-erd) that might hook into db:migrate tasks and break squasher. We use an environment variable here because squasher runs outside the Rails process. So the Rails app can't reference the Squasher runtime itself. fixes #83 --- lib/squasher.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/squasher.rb b/lib/squasher.rb index cf6db4c..9c8d1bc 100644 --- a/lib/squasher.rb +++ b/lib/squasher.rb @@ -28,7 +28,7 @@ def clean def rake(command, description = nil) tell(description) if description config.in_app_root do - env = { 'RAILS_ENV' => 'development', 'DISABLE_DATABASE_ENVIRONMENT_CHECK' => '1' } + env = { 'RAILS_ENV' => 'development', 'DISABLE_DATABASE_ENVIRONMENT_CHECK' => '1', 'SQUASHER_IN_PROGRESS' => '1' } system(env, "bundle exec rake #{ command }") end end