DEV: Add option to precompile default multisite stylesheets

This commit is contained in:
Penar Musaraj 2020-09-03 12:59:53 -04:00
parent 4f48304a44
commit 7a0d1cadc5
No known key found for this signature in database
GPG Key ID: E390435D881FF0F7
1 changed files with 2 additions and 2 deletions

View File

@ -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