From 61f6f53dabc4262162839053b358357046d99ca7 Mon Sep 17 00:00:00 2001 From: Krzysztof Kotlarek Date: Tue, 27 Oct 2020 10:17:21 +1100 Subject: [PATCH] PERF: apply sprockets patch in a test environment (#11034) When plugin spec is evaluated for the first time, it took 30 seconds to run: ``` rm -rf tmp/* && LOAD_PLUGINS=1 be rspec ./plugins/discourse-solved/spec/requests/topics_controller_spec.rb ``` Applying sprocket patch in test environment solves that issue --- lib/freedom_patches/sprockets_patches.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/freedom_patches/sprockets_patches.rb b/lib/freedom_patches/sprockets_patches.rb index 0269580d776..eb85a23ca60 100644 --- a/lib/freedom_patches/sprockets_patches.rb +++ b/lib/freedom_patches/sprockets_patches.rb @@ -8,7 +8,7 @@ # 2. Stop using a concatenator that does tons of work checking for semicolons when # when rebuilding an asset -if Rails.env == "development" +if Rails.env.development? || Rails.env.test? module ActionView::Helpers::AssetUrlHelper def asset_path(source, options = {})