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