From 9d46823b5d00e78c6ffaaae731a9a7acf6bb2b14 Mon Sep 17 00:00:00 2001 From: Terence Lee Date: Thu, 22 Sep 2011 12:03:59 -0500 Subject: [PATCH] set env to let rails know we're precompiling --- actionpack/lib/sprockets/assets.rake | 3 +++ railties/test/application/assets_test.rb | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/actionpack/lib/sprockets/assets.rake b/actionpack/lib/sprockets/assets.rake index e38ac6b489..7241671db0 100644 --- a/actionpack/lib/sprockets/assets.rake +++ b/actionpack/lib/sprockets/assets.rake @@ -1,6 +1,9 @@ namespace :assets do desc "Compile all the assets named in config.assets.precompile" task :precompile do + # let rails know we're precompiling assets + ENV["RAILS_ASSETS_PRECOMPILE"] = 'true' + # We need to do this dance because RAILS_GROUPS is used # too early in the boot process and changing here is already too late. if ENV["RAILS_GROUPS"].to_s.empty? || ENV["RAILS_ENV"].to_s.empty? diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb index a62ef1e70e..c4a24f0f73 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -102,6 +102,15 @@ module ApplicationTests assert !File.exists?("#{app_path}/public/assets/something.min.css") end + test "precompile sets flag notifying rails its precompiling" do + compile = <