From 7a0d1cadc5c867ac1e5ae2184a6e92589d631f35 Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Thu, 3 Sep 2020 12:59:53 -0400 Subject: [PATCH] DEV: Add option to precompile default multisite stylesheets --- lib/tasks/assets.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index 87a32da0c5c..585244a49f6 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -50,9 +50,9 @@ task 'assets:precompile:css' => 'environment' do STDERR.puts "Start compiling CSS: #{Time.zone.now}" RailsMultisite::ConnectionManagement.each_connection do |db| - # Heroku precompiles assets before db migration, so tables may not exist. - # css will get precompiled during first request instead in that case. + next if ENV["PRECOMPILE_SHARED_MULTISITE_CSS"] == "1" && db != "default" + # css will get precompiled during first request if tables do not exist. if ActiveRecord::Base.connection.table_exists?(Theme.table_name) STDERR.puts "Compiling css for #{db} #{Time.zone.now}" begin