From f6944844ebcc88f0c26b855f5f11133aef65be63 Mon Sep 17 00:00:00 2001 From: Markus Seeger Date: Fri, 20 Dec 2013 11:48:53 +0100 Subject: [PATCH] test for dev/test env instead of production test for "production" is dangerous since there might also be "staging" etc. --- lib/i18n-js/engine.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/i18n-js/engine.rb b/lib/i18n-js/engine.rb index 5d606ecd..8a728dba 100644 --- a/lib/i18n-js/engine.rb +++ b/lib/i18n-js/engine.rb @@ -35,7 +35,9 @@ class Engine < ::Rails::Engine # rewrite path cache hash at startup and before each request in development config.to_prepare do next unless SimplesIdeias::I18n.has_asset_pipeline? - SimplesIdeias::I18n::Engine.write_hash_if_changed unless Rails.env.production? + if Rails.env.development? || Rails.env.test? + SimplesIdeias::I18n::Engine.write_hash_if_changed + end end def self.load_path_hash_cache