From 1e4138f50bae84becd2514d2c41f3d9c5b5a0764 Mon Sep 17 00:00:00 2001 From: Daniel Jackson Date: Tue, 30 Jan 2024 11:06:53 +0100 Subject: [PATCH] Stop rubocop from messing with our code --- lib/tasks/precompile_assets_once.rake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/tasks/precompile_assets_once.rake b/lib/tasks/precompile_assets_once.rake index 8de7ce37..f6672e89 100644 --- a/lib/tasks/precompile_assets_once.rake +++ b/lib/tasks/precompile_assets_once.rake @@ -1,6 +1,9 @@ # frozen_string_literal: true -task "precompile_assets_once" => :environment do +# rubocop:disable Rails/RakeEnvironment +# Rubocop Rails/RakeEnvironment breaks this function, as it needs to run +# before the environment is loaded. +task "precompile_assets_once" do next if ENV["TEST_ASSET_PRECOMPILE_DONE"] p "Compiling assets..." @@ -11,3 +14,4 @@ task "precompile_assets_once" => :environment do p "Assets compiled" end +# rubocop:enable Rails/RakeEnvironment