From 70318fdbbc7d17d62bbd983c1353bf79d067ac46 Mon Sep 17 00:00:00 2001 From: Mostafa Ahangarha Date: Thu, 5 Oct 2023 11:16:54 +0330 Subject: [PATCH] Fix memoization --- lib/shakapacker/digest_strategy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/shakapacker/digest_strategy.rb b/lib/shakapacker/digest_strategy.rb index 14662751..282ee26b 100644 --- a/lib/shakapacker/digest_strategy.rb +++ b/lib/shakapacker/digest_strategy.rb @@ -64,7 +64,7 @@ def generate_host_hash(*keys) keys = [Rails.application.config.asset_host, ENV["SHAKAPACKER_ASSET_HOST"]] if keys.empty? - @generated_host_hashes[keys] = Digest::SHA1.hexdigest(keys.join("-")) + @generated_host_hashes[keys] ||= Digest::SHA1.hexdigest(keys.join("-")) end end end